How to parse the date_added field in Chrome Bookmarks file?
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