coolair
V2EX  ›  问与答

数据库(MySQL)存的是 UTC 时间,现在按年、月统计的时候,使用 extract 会导致数据有些不准,有什么好办法吗?

  •  
  •   coolair · Apr 10, 2019 · 1381 views
    This topic created in 2624 days ago, the information mentioned may be changed or developed.
    2 replies    2019-04-11 15:44:52 +08:00
    julyclyde
        2
    julyclyde  
       Apr 11, 2019
    不准是因为夏令时还是因为闰秒?
    成熟的处理函数+正确的 locale 设置可以解决

    如果不能,那大概是你写的有问题了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   935 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 21:10 · PVG 05:10 · LAX 14:10 · JFK 17:10
    ♥ Do have faith in what you're doing.