PHP Classes

Visuaal Fox Pro DateTime fields

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Visuaal Fox Pro DateTime fields  
Subject:Visuaal Fox Pro DateTime fields
Summary:Can't decode Visual Fox Pro Date Time fields
Messages:9
Author:Larry Wakeman
Date:2011-10-11 17:51:27
Update:2011-10-20 21:54:23
 

  1. Visuaal Fox Pro DateTime fields   Reply   Report abuse  
Picture of Larry Wakeman 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

There are 8 replies in this thread, which are not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.