Is there a way to check to see if a date/time is valid you would think these would be easy to check:
$date = \'0000-00-00\';
$time = \'00:00:00\';
$dateTime
I have used the following code to validate dates coming from ExtJS applications.
function check_sql_date_format($date) {
$date = substr($date, 0, 10);
list($year, $month, $day) = explode('-', $date);
if (!is_numeric($year) || !is_numeric($month) || !is_numeric($day)) {
return false;
}
return checkdate($month, $day, $year);
}