get_separated_date()
get_separated_date(array $params, string $prefix, $dflt) : int
Get a unix timestamp from separate month, day and year fields.
This method is useful for converting dates a user entered into separate month day and year fields into a unix timestamp.
i.e: if using the smarty {html_select_date} field for gathering dates.
This method assumes that there will be separate fields in the params array who's values are integers, and the
key begins with the provided prefix and ends with _Month, _Day, and _Year respectively.
Note, if the year parameter does not exist in the params array, but month and day do... then the current year is used.
Parameters
array |
$params |
|
string |
$prefix |
The common prefix for the separate month, day and year parameters |
|
$dflt |
|
Returns
int
— A unix timestamp representing the day found, at midnight.