orzfly

UNIX 时间戳超过 1500000000 啦

  •  3
     
  •   orzfly · Jul 14, 2017 · 4687 views
    This topic created in 3399 days ago, the information mentioned may be changed or developed.
    irb(main):001:0> Time.at 1400000000
    => 2014-05-14 00:53:20 +0800
    
    irb(main):002:0> Time.at 1500000000
    => 2017-07-14 10:40:00 +0800
    
    irb(main):003:0> Time.at 1600000000
    => 2020-09-13 20:26:40 +0800
    
    12 replies  •  2017-07-14 16:02:45 +08:00
    davidqw
    davidqw
    Jul 14, 2017 via iPhone
    1
    期待 2000000000
    GOOD21
    GOOD21
    Jul 14, 2017
    2
    时间过得真快。
    ming2050
    ming2050
    Jul 14, 2017 via iPhone
    3
    快溢出了
    Xrong
    Xrong
    Jul 14, 2017❤️1
    4
    真不容易。。。
    coooooooode
    coooooooode
    Jul 14, 2017
    5
    刚刚在 mysql 上用 int 类型试了一下溢出位
    无符号 4294967295 → 2106-2-7 14:28:15
    有符号 2147483647 → 2038-1-19 11:14:07
    Lothar
    Lothar
    Jul 14, 2017❤️2
    6
    真是巧了,今天刚好发现代码里一个 bug,导致线上出了问题。。

    ```
    if (/^14\d{11}$/.test(value)) {
    value = moment(parseInt(value, 10)).format('YYYY-MM-DD HH:mm:ss');
    }
    ```
    amorphobia
    amorphobia
    Jul 14, 2017
    7
    @Lothar 千年虫都过去这么多年了
    RqPS6rhmP3Nyn3Tm
    RqPS6rhmP3Nyn3Tm
    Jul 14, 2017
    8
    就算 UNIX 时间戳溢出了,那个人依然活着
    cocochan
    cocochan
    Jul 14, 2017 via iPhone
    9
    @BXIA 真暴力
    thecon
    thecon
    Jul 14, 2017
    10
    嗯,刚刚感慨了下, 然后居然就看到这个帖子了
    zhuangtongfa
    zhuangtongfa
    Jul 14, 2017
    11
    @BXIA 这么暴力
    Antidictator
    Antidictator
    Jul 14, 2017 via Android
    12
    @BXIA 暴力魔不可取啊
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5317 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 06:16 · PVG 14:16 · LAX 22:16 · JFK 01:16
    ♥ Do have faith in what you're doing.