The purpose of this is to test Date conversion functions from the Windows double format to the Unix integer format.
dbf Value | New Value | Date | ||
---|---|---|---|---|
$sec_per_day | 86400 | 24*60*60 = 86,400 | ||
$date_convert | 2209075200 | 1903-11-26 05:31:44 pm | ((70)*365 + floor(70/4) + 1) * 86400 - should be 2040-01-01 00:00:00 midnight | |
38727.6763 | 38727.6763 | 1970-01-01 | Date without any conversion - actual value from table | |
dbf | 1970-01-01 10:45:27 am | Same as above, but with the time displayed - date('Y-m-d h:i:s a', $a) | ||
converted | 1136996032.32 | 2006-01-11 04:13:52 pm | Converted data - $a = ($a * $sec_per_day) - $date_convert; | |
newest date | 41088.6715 | 1340986017.6 | 2012-06-29 04:06:57 pm | Most recent date in database |
newest date + LSD | 41088.6716 | 1340986026.24 | 2012-06-29 04:07:06 pm | Same as above plus the least significant digit - about 9 seconds difference |
now | 1342986349 | 2012-07-22 07:45:49 pm | Current time | |
now - 3 days | 1342727149 | 2012-07-19 07:45:49 pm | Demonstration that the values work | |
now - 3 yrs | 1248032749 | 2009-07-19 07:45:49 pm | Ditto |
These functions convert from Window time (days since 12-30-1899) to Unix time (seconds since 01-01-1970). This procedure is
The real problem is that Unix dates fail after 2038! (As shown above where 2040 is shown as 1903!)
There are 2 versions of this page - php and html (for when the PHP version changes - this was developed with version 5.4.3).
Author: Robert Clemenzi