devilish666@lemmy.world to Programmer Humor@lemmy.ml · 8 months agoDaylight saving creator left the chat....lemmy.worldexternal-linkmessage-square31fedilinkarrow-up10arrow-down10
arrow-up10arrow-down1external-linkDaylight saving creator left the chat....lemmy.worlddevilish666@lemmy.world to Programmer Humor@lemmy.ml · 8 months agomessage-square31fedilink
minus-squareDaxtron2@startrek.websitelinkfedilinkarrow-up0·8 months agoStore in UTC with the tz offset and if you’re using a modern tz library, that should handle it for you.
minus-squarePhrodo_00@lemmy.worldlinkfedilinkarrow-up0·8 months agotz offset is really not enough. You’d need to save the time zone id and/or offset, to have you library calculate deviations such as daylight savings. Even that, that would break if the user moves and now what they setup is using their previous timezone. Basically, I’m saying that storing the offset works most of the time, but not all of the time.
Store in UTC with the tz offset and if you’re using a modern tz library, that should handle it for you.
tz offset is really not enough. You’d need to save the time zone id and/or offset, to have you library calculate deviations such as daylight savings.
Even that, that would break if the user moves and now what they setup is using their previous timezone.
Basically, I’m saying that storing the offset works most of the time, but not all of the time.