date_from_form()
date_from_form(array $params, string $prefix, string $prefix2) : int
Given month, day year input fields in parameters, and a prefix create a unix timestamp this is useful when processing form data from {html_select_date}
i.e: $ts = \cge_date_utils::date_from_form($params,$id,'startdate');
Parameters
array | $params | An associative array, usually from form submission. |
string | $prefix | The prefix for the Month, Day, and Year fields within the params array |
string | $prefix2 | An optional second prefix to append to the first one (i.e: the field name) |
Returns
int —unix timestamp representing the date in the input parmeters at 00:00 hours. or null