im using PHP 5.3 and have read alot of material in that matter but still cant fins a solution.
I want to import birthdays 01/10/1945 from excel into mysql using php whatever i tried did not give me the result (im getting a negative number)
here is the last solution that i have tried :
$data is the excel file (im using excel reader class for that)
$date_of_birth = ($data->sheets[0]['cells'][$i][11] - 25569) * 86400;
the result was -2207692800
what am i doing wring here ?
Dates before the Unix epoch are represented as negatives in PHP, so you're not doing anything wrong.
When you use any of the date time
functions on the timestamps, you'll get the correct value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With