MySQL Forums
Forum List  »  Data Recovery

Reading DATETIME from MYD files
Posted by: Martin Fredriksson
Date: June 03, 2014 08:49AM

For corruption recovery issues, I have to retrieve dates from a table which I only have the .MYD file for.

The MySQL internals tells me that DATETIME:s are stored in 8 bytes:

DATETIME: Eight bytes: A four-byte integer for date packed as YYYY×10000 + MM×100 + DD and a four-byte integer for time packed as HH×10000 + MM×100 + SS

I have a known date of "2010-02-09 19:57:58", in the .MYD file this is represented by:

EE 3A D4 F1 47 12 00 00

"2010-02-05 14:24:17" is 91 61 96 F1 47 12 00 00

And so on.

However I cannot find any more documentation on how to actually convert these values to human readable dates. I read somewhere that the value is actually a timestamp with number of days since 1900-01-01, but I cannot find that right now.

How to parse these values as human readable dates?

Options: ReplyQuote

Written By
Reading DATETIME from MYD files
June 03, 2014 08:49AM

Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.