You are here

function event_check_date in Event 5.2

Check date string for consistency, values are not checked

dddd-dd-dd dd:dd and dddd-dd-dd dd:dd:dd are both valid.

Parameters

$date datetime string:

Return value

TRUE or FALSE

File

./event.module, line 2671

Code

function event_check_date($date) {
  return (bool) preg_match('/^\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d(:\\d\\d)?$/', $date);
}