function date_preg in Date 5
Regex validation for iso date
4 calls to date_preg()
- date_iso2array in ./
date.inc - date_iso2unix in ./
date.inc - date_range_value in ./
date_views.inc - Validate and pad date range argument element
- date_text2iso in ./
date.inc - Use stringtotime function to create an iso date out of text
File
- ./
date.inc, line 1600 - Date/time API functions
Code
function date_preg($item) {
if (preg_match('/([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/', $item)) {
return TRUE;
}
else {
return FALSE;
}
}