V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
coolair
V2EX  ›  问与答

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

  •  
  •   coolair · Apr 10, 2019 · 1298 views
    This topic created in 2581 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   ·   2891 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 07:17 · PVG 15:17 · LAX 00:17 · JFK 03:17
    ♥ Do have faith in what you're doing.