I'm entering certain dates and validated using php but I found these errors he had ever had.
The function I use to verify if the date is valid or not is:
public function fecha($field){
$field = '18-11-1901';
if (date('d-m-Y', strtotime($field)) == $field) {
print_r("bien".$field);
exit;
return true;
} else {
print_r("mal".$field);
exit;
return false;
}
return true;
}
At that time I try to roll a mistake, that the date is not correct. from 1901 down fails. But from 1902 up works well. Why does this happen ?.
Error list:
18-11-1901
18-11-1800
I understand that there are limits to the dates, but there is no way to fix it? Transforming it into another format or something?