How are DateTime and Number formats encoded in Jet4?

后端 未结 2 1252
一整个雨季
一整个雨季 2021-01-27 09:46

I\'m writing a low level tool to scan and recover data from damaged Jet4 MDB files. I\'m scanning through pages, parsing Rows, and decoding columns.

If I have the raw 8

2条回答
  •  粉色の甜心
    2021-01-27 10:20

    If I have the raw 8 byte value for Datetime fields, how can I convert this to a string representation of the date such as "MM-DD-YY HH:MM:SS"?

    Access stores Date/Time values as 64 bit (8 byte) Double values in little-endian format. The integer portion represents the number of days before or after the Access "epoch" (1899-12-30 00:00:00) and the absolute value of the fractional portion represents the time portion for that day (e.g., 0.5 = Noon). So, for example, in Python we would convert the bytes into a datetime value like so:

    from datetime import datetime, timedelta
    import struct
    
    # bytes as retrieved from .accdb or .mdb file
    d_as_bytes = b'\x35\x07\x2F\x2C\x93\x63\xDD\xC0'
    
    d_as_double = struct.unpack('

提交回复
热议问题