I have a form where users can enter a birthdate. If a date prior to 1970 is entered, e.g. 1964, it is saved in the database as 2064. Can anyone shed some light on what is happening? Thanks. I am formatting the dates for MySQL using the function below:
function formatdate( $s ) {
$date = date_create($s);
return date_format($date, 'y-m-d');
}
MySQL assumes that years less than 70 (when not given as a 4 digit year) are in the 21st century and not the 20th. You should format as a 4 digit year to avoid this problem: