问题
I am trying to convert a dBase .dbf File to a mySQL Database... Its pretty straight forward, but I am stuck at the Timestamp, that is used in my .dbf Database...
Here are some Timestamps + the corresponding Date and Time Values:
41594.722222222 - 16.11.2013, 17:20 3472222
41594.725694444 - 16.11.2013, 17:25 3472223
41594.729166667 - 16.11.2013, 17:30 3472222
41594.732638889 - 16.11.2013, 17:35 3472222
41594.736111111 - 16.11.2013, 17:40 3472222
41594.739583333 - 16.11.2013, 17:45 3472223
41594.743055556 - 16.11.2013, 17:50 3472222
41594.746527778 - 16.11.2013, 17:55 3472222
41594.75 - 16.11.2013, 18:00 3472222
41594.753472222 - 16.11.2013, 18:05 3472222
41594.756944444 - 16.11.2013, 18:10 3472223
41594.760416667 - 16.11.2013, 18:15
41594.763888889 - 16.11.2013, 18:20
41594.767361111 - 16.11.2013, 18:25
41594.770833333 - 16.11.2013, 18:30
41594.774305556 - 16.11.2013, 18:35
41594.777777778 - 16.11.2013, 18:40
41594.78125 - 16.11.2013, 18:45
41594.784722222 - 16.11.2013, 18:50
The first Value (x.y) is the Timestamp as it is stored in my .dbf File. The second Value is the corresponding Date_Time Value. The third Value is the Difference between the actual and the next Timestamp (5 minutes^^)
I already found some hints on this Page: http://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
It says: "8 bytes - two longs, first for date, second for time. The date is the number of days since 01/01/4713 BC. Time is hours * 3600000L + minutes * 60000L + Seconds * 1000L"
I am not quite sure, if it fits for my timestamp format^^ when i try to convert the days(41594) to years and start counting from "01/01/4713 BC.", i am getting not even close to 2013 :D
So, does anyone have any idea, how to convert this type of timestamp into a readable format?
回答1:
Try to start count from 12/31/1899 instead of 01/01/4713 BC.
来源:https://stackoverflow.com/questions/20026154/convert-dbase-timestamp