I've looked at
and loads of other articles on the internet but I cannot for the life of me understand how to convert the date_added field in the Chrome Bookmarks files (Windows) to a sensible number.
For instance 13024882639633631
is supposed to be a date in September 2013 but I tried all possible calculations in the 1st link I cited but can't seem to get a sensible date. It keeps calculating the date as 2010.
i have checked it with chrome bookmarks and it gave correct values for all. 13024882639633631
appears to be yesterday. check here https://code.google.com/p/chromium/codesearch#chromium/src/base/time/time_win.cc&sq=package:chromium&type=cs and search for MicrosecondsToFileTime
import datetime
def getFiletime(dt):
microseconds = int(dt, 16) / 10
seconds, microseconds = divmod(microseconds, 1000000)
days, seconds = divmod(seconds, 86400)
return datetime.datetime(1601, 1, 1) + datetime.timedelta(days, seconds, microseconds)
print format(getFiletime(hex(13024882639633631*10)[2:17]), '%a, %d %B %Y %H:%M:%S %Z')
This is just a conversion of the answer by Zaw LIn to python 3.
import datetime
def getFiletime(dtms):
seconds, micros = divmod(dtms, 1000000)
days, seconds = divmod(seconds, 86400)
return datetime.datetime(1601, 1, 1) + datetime.timedelta(days, seconds, micros)
print( getFiletime(13024882639633631).strftime( '%a, %d %B %Y %H:%M:%S %Z' ) )
Output: Sat, 28 September 2013 22:57:19
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With