function date_iso2unix in Date 5
8 calls to date_iso2unix()
- date_custom2unix in ./date.inc
- date_iso2array in ./date.inc
- date_iso_week_range in ./date.inc
- Compute min and max dates for an ISO week
- date_set_date in ./date.inc
- Function to set local and db date parts in the date object
- date_text2unix in ./date.inc
... See full list
File
- ./date.inc, line 1213
- Date/time API functions
Code
function date_iso2unix($iso) {
if (!date_preg($iso)) {
return 'ERROR';
}
if (!date_is_valid($iso, DATE_ISO)) {
return 'ERROR';
}
if (date_iso_year($iso)) {
$array = array(
'hours' => date_iso_hours($iso),
'minutes' => date_iso_minutes($iso),
'seconds' => date_iso_seconds($iso),
'mon' => max(1, date_iso_mon($iso)),
'mday' => max(1, date_iso_day($iso)),
'year' => date_iso_year($iso),
);
$unix = date_gmmktime($array);
if ($unix == -1) {
return 'ERROR';
}
return $unix;
}
else {
return NULL;
}
}