Google Bookmark Export date format?

Chrome uses a modified form of the Windows Time format (“Windows epoch”) for its timestamps, both in the Bookmarks file and the history files. The Windows Time format is the number of 100ns-es since January 1, 1601. The Chrome format is the number of microseconds since the same date, and thus 1/10 as large.

To convert a Chrome timestamp to and from the Unix epoch, you must convert to seconds and compensate for the difference between the two base date-times (11644473600).

Here’s the conversion formulas for Unix, JavaScript (Unix in milliseconds), Windows, and Chrome timestamps (you can rearrange the +/× and -/÷, but you’ll lose a little precision):

u :  Unix       timestamp    eg: 1378615325
j :  JavaScript timestamp    eg: 1378615325177
c :  Chrome     timestamp    eg: 13902597987770000
w :  Windows    timestamp    eg: 139025979877700000

u =  (j / 1000)
u =  (c - 116444736000000)   / 10000000
u =  (w - 1164447360000000)  / 100000000

j =  (u * 1000)
j =  (c - 116444736000000)   / 10000
j =  (w - 1164447360000000)  / 100000

c =  (u * 10000000)          + 116444736000000
c =  (j * 10000)             + 116444736000000
c =  (w / 10)

w =  (u * 100000000)         + 1164447360000000
w =  (j * 100000)            + 1164447360000000
w =  (c * 10)

Note that these are pretty big numbers, so you’ll need to use 64-bit numbers or else handle them as strings like with PHP’s BC-math module.


In Javascript the code will look like this

function chromeDtToDate(st_dt) {
   var microseconds = parseInt(st_dt, 10);
   var millis = microseconds / 1000;
   var past = new Date(1601, 0, 1).getTime();
   return new Date(past + millis);
}