Larry Wakeman - 2011-10-11 17:51:27
I am using a modified DBF Class (http://www.phpclasses.org/package/1302-PHP-Extract-information-from-a-DBF-database-file.html) to read dbase and fox pro tables to import into MySQL. I am having a problem decoding the dtae Time (timestamp) fields. The data looks like two longs encoded into an eight byte string. Bytes 3 and 7 are 0, indicating that they are little endian longs. What I have been able to infer from 'documentation' on the web (mostly examples in various programming languages) is that the first value is a date that some say is the number of days since 1/1/1980 (or 1/1/1980 for the Europeans ;-) and the second value is the number of seconds from midnight.
So, I tried:
date('Y-m-d H:i', ($val1 * 24 * 60 * 60) + mktime(0,0,0,1,1,1980) + $val2)
I tried other perturbations including one based on the Biblical Epoch (1/1/4713 BC) that was used by dBase.
Any one have any ideas, code snippets... that could be of helop?
Thanks in advance
Larry