PyLZMA lastwritetime file to python datetime

rabusta rabusta at gmail.com
Fri Apr 22 06:14:36 EDT 2011


On Apr 22, 5:12 pm, Chris Rebert <c... at rebertia.com> wrote:
> [Mildly educated guess after scanninghttps://github.com/fancycode/pylzma/blob/master/py7zlib.py]:
>
> It's likely a Unix timestamp. Perhaps try
> datetime.datetime.utcfromtimestamp() or
> datetime.datetime.fromtimestamp() ?http://docs.python.org/library/datetime.html#datetime.datetime.utcfro...http://docs.python.org/library/datetime.html#datetime.datetime.fromti...
>

Thanks for the reply!
but lastwritetime contains 64bit value and function
datetime.fromtimestamp an error (timestamp out of range for platform
time_t), I tried to take only the upper 32bit, but it does not
correspond to the actual date file...

for example:
>>> f.header.files.files[0]['lastwritetime']
14620470108690448384L

real date: 2010-04-28 06:22:20



More information about the Python-list mailing list