coolair
V2EX  ›  问与答

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

  •  
  •   coolair · Apr 10, 2019 · 1330 views
    This topic created in 2593 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   ·   1669 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 84ms · UTC 16:24 · PVG 00:24 · LAX 09:24 · JFK 12:24
    ♥ Do have faith in what you're doing.