• arc@lemm.ee
    link
    fedilink
    arrow-up
    30
    ·
    21 hours ago

    The sane way of dealing with it is to use UTC everywhere internally and push local time and local formatting up to the user facing bits. And if you move time around as a string (e.g. JSON) then use ISO 8601 since most languages have time / cron APIs that can process it. Often doesn’t happen that way though…

    • nBodyProblem@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      6 hours ago

      The BEST way is to use the number of seconds after the J2000 epoch (The Gregorian date January 1, 2000, at 12:00 Terrestrial Time)

    • expr@programming.dev
      link
      fedilink
      arrow-up
      7
      ·
      19 hours ago

      Generally yes, that’s the way to do it, but there are plenty of times where you need to recreate the time zone something was created for, which means additionally storing the time zone information.

    • hazypenguin@feddit.nl
      link
      fedilink
      arrow-up
      4
      ·
      19 hours ago

      Definitely. If your servers aren’t using UTC, then when you’re trying to sync data between different timezones, you’re making it harder for yourself.