I got data from a Persavive V12 Db. The dates are in a weird format. They are like float :
Example of date in table : 39787.0
Do someone know this kind of format ? It seems to be the number of days from 1901-01-01.
Since the dates are float, is it possible to add days from a date in PHP ? Like :
$from = '1901-01-01';
$date = date('Y-m-d', strtotime($from .' +'. $float .' days'));
I got always 1970-01-01. Is there another way ?
My first answer so don't hurt me much. I'm not quite sure what you want to do (put back in the database or perform further operations so I only posted one solution)
The number you posted 39787.0 is a unix timestamp. You need to use mktime to convert what you want to a number (And you need date to convert it to a readable form). Since mktime uses 1901-01-01 as a starting date as well you have to make a couple of changes.
I was a biz lazy and didn't include all the code for all fields but this should allow you modify to add whatever you want (and possibly clean it up to a single line if you want). I made it in long form so it's easy to read.