I used some date functions surrounding the French Republic of 1792-1806. But I want to know if the (PHP8) date functions can handle these dates.
function CheckFrDate($CheckDate){ $BeginFrDate = date_create_from_format('d/m/Y', '22/09/1792'); $EndFrDate = date_create_from_format('d/m/Y', '22/09/1806'); if ( $CheckDate->getTimestamp() > $BeginFrDate->getTimestamp() && $CheckDate->getTimestamp() < $EndFrDate->getTimestamp()){ return 1; }else{ return -1; } }
So a date like September 23, 1793 should be fine. But my function keeps returning false.
If the date function returns false, you can get detailed error information by calling var_dump(date_get_last_errors()).
More information: https://www.php.net/manual/en/function.date-get-last-errors.php