@[email protected] to Programmer [email protected] • 1 year agoDaylight saving creator left the chat....lemmy.worldimagemessage-square39fedilinkarrow-up1403arrow-down119
arrow-up1384arrow-down1imageDaylight saving creator left the chat....lemmy.world@[email protected] to Programmer [email protected] • 1 year agomessage-square39fedilink
minus-square@[email protected]linkfedilink1•1 year agoIt depends. If something needs to happen in local time (like, always at the same time regardless of daylights savings for example) you should be storing times in local timezone
minus-square@[email protected]linkfedilink2•1 year agoStore in UTC with the tz offset and if you’re using a modern tz library, that should handle it for you.
minus-square@[email protected]linkfedilink2•1 year 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.
It depends. If something needs to happen in local time (like, always at the same time regardless of daylights savings for example) you should be storing times in local timezone
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.