What is the format of Chrome's timestamps?

前端 未结 6 1236
隐瞒了意图╮
隐瞒了意图╮ 2020-12-13 00:33

I\'m using SQLite Database Browser to read information from a database containing the browsing history for Google Chrome. My current code that I am executing in the \"Execut

6条回答
  •  我在风中等你
    2020-12-13 00:59

    The answer is given in this question: "[Google Chrome's] timestamp is formatted as the number of microseconds since January, 1601"

    So for example in my sample history database, the query

    SELECT
      datetime(visit_time / 1000000 + (strftime('%s', '1601-01-01')), 'unixepoch', 'localtime')
    FROM visits
    ORDER BY visit_time DESC
    LIMIT 10;
    

    gives the results:

    2014-09-29 14:22:59
    2014-09-29 14:21:57
    2014-09-29 14:21:53
    2014-09-29 14:21:50
    2014-09-29 14:21:32
    2014-09-29 14:21:31
    2014-09-29 14:16:32
    2014-09-29 14:16:29
    2014-09-29 14:15:05
    2014-09-29 14:15:05
    

    Using your timestamp value of 13029358986442901:

    SELECT
      datetime(13029358986442901 / 1000000 + (strftime('%s', '1601-01-01')), 'unixepoch', 'localtime')
    

    the result is:

    2013-11-19 18:23:06
    

提交回复
热议问题