Chrome 的时间戳格式是什么?

What is the format of Chrome#39;s timestamps?(Chrome 的时间戳格式是什么?)
本文介绍了Chrome 的时间戳格式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 SQLite 数据库浏览器从包含 Google Chrome 浏览历史记录的数据库中读取信息.我在执行 SQL"面板中执行的当前代码如下所示:

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 "Execute SQL" panel looks like this:

SELECT last_visit_time,url,title
FROM urls
WHERE url LIKE {PLACEHOLDER} AND title LIKE {PLACEHOLDER}

出于隐私目的,WHERE"行中的内容被 {PLACEHOLDER} 屏蔽.现在,我想让 last_visit_time 列中返回的数据可读,而不是像 13029358986442901 这样的混乱混乱.如何执行此操作以及如何将 Chrome 的时间戳转换为可读格式?我如何让它按 last_visit_time 对它们(返回的行)进行排序?

The stuff on the "WHERE" line is blocked out with {PLACEHOLDER} for privacy purposes. Now, I want to make it such that the data returned in the last_visit_time column is readable instead of a jumbled mess like 13029358986442901. How do I do this and how do I convert Chrome's timestamp to a readable format? How do I get it to order them (the returned rows) by last_visit_time?

推荐答案

答案在这个问题: "[Google Chrome's] 时间戳被格式化为自 1601 年 1 月以来的微秒数"

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;

给出结果:

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

使用您的时间戳值 13029358986442901:

Using your timestamp value of 13029358986442901:

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

结果是:

2013-11-19 18:23:06

这篇关于Chrome 的时间戳格式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

FastAPI + Tortoise ORM + FastAPI Users (Python) - Relationship - Many To Many(FastAPI+Tortoise ORM+FastAPI用户(Python)-关系-多对多)
Window functions not working in pd.read_sql; Its shows error(窗口函数在pd.read_sql中不起作用;它显示错误)
(Closed) Leaflet.js: How I can Do Editing Geometry On Specific Object I Select Only?((已关闭)Leaflet.js:如何仅在我选择的特定对象上编辑几何图形?)
in sqlite update trigger with multiple if/Case Conditions(在具有多个IF/CASE条件的SQLite UPDATE触发器中)
Android: Why is Room so slow?(Android:为什么Room这么慢?)
Remote Procedure call failed with sql server 2008 R2(使用 sql server 2008 R2 的远程过程调用失败)