coolair
V2EX  ›  问与答

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

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

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