V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
tuding
V2EX  ›  程序员

为什么 chrome 浏览器的时间戳是从 1601-01-01 0:0:0 开始纪元的呢?

  •  
  •   tuding · 2019-04-12 18:05:13 +08:00 · 2626 次点击
    这是一个创建于 1838 天前的主题,其中的信息可能已经有所发展或是发生改变。
    The current WebKit timestamp is 13199537040000000
    为什么要用这么奇葩的时间戳? 是有什么原因吗?
    7 条回复    2019-04-12 21:04:45 +08:00
    creanme
        1
    creanme  
       2019-04-12 18:08:35 +08:00   ❤️ 1
    chrome 是从电脑本地获取的时间,这边有说明为什么
    https://stackoverflow.com/questions/10849717/what-is-the-significance-of-january-1-1601
    geelaw
        2
    geelaw  
       2019-04-12 18:10:52 +08:00 via iPhone   ❤️ 2
    这个是 Win32 epoch。因为 Gregorian Calendar 的周期是 400 年,这个时间是 Windows NT 开发的时候的最近的周期开始点。这样选择可以让一些数学更简单。

    https://devblogs.microsoft.com/oldnewthing/20090306-00/?p=18913
    tuding
        3
    tuding  
    OP
       2019-04-12 18:13:41 +08:00
    @creanme #1
    @geelaw #2
    原来如此
    halk
        4
    halk  
       2019-04-12 18:13:56 +08:00
    Here ’ s a few examples of this madness:

    NTFS  —  The number of 100ns intervals since January 1, 1601, 12:00:00 AM UTC.
    HFS+ —  The number of seconds since January 1, 1904 12:00:00 AM UTC.
    Mac “ Absolute Time ” —  The number of seconds since January 1, 2001, 12:00:00 AM UTC.
    Epoch/Unix/POSIX  —  The number of seconds since January 1, 1970, 12:00:00 AM UTC.
    Chrome/Webkit  —  The number of milliseconds since January 1, 1601, 12:00:00 AM UTC.
    saluton
        5
    saluton  
       2019-04-12 18:39:49 +08:00
    我感觉跟 1582 年历法改革有关(我还没看一二楼
    ysc3839
        6
    ysc3839  
       2019-04-12 19:10:44 +08:00 via Android
    @creanme @geelaw @halk
    想问下非 Windows 系统的 WebKit 也是使用这种 timestamp 吗?如果是的话又是为什么呢?也是为了方便计算?
    creanme
        7
    creanme  
       2019-04-12 21:04:45 +08:00
    @ysc3839 没在非 windows 上用过 webkit (逃
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3929 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 05:11 · PVG 13:11 · LAX 22:11 · JFK 01:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.