I have to migrate an Access database to MySQL. I have two problems: first is year is specified with two digits; second is that this is a birthday database. For example I have strings like this:
"06/12/76 00:00:00"
"10/15/02 00:00:00"
Which year is refering last one (October 15th)? I'll assume that all dates which have a year value over 12 are refering to 19XX and the other (from 0 to 12) to this century: 20XX.
Once resolved this problem I need to format these dates. I've try this:
$bd = strtotime($birth);
if ($bd > time()) {
$bd = strtotime("-100 years", $bd);
}
$birth = sua_date_unix2mysql($bd);
But the problem is strtotime
only is able to manage dates after 1970. Any idea to resolve this problem?
NOTE: Datetime is not available (version 5.2)