this post was submitted on 03 Apr 2024
226 points (94.8% liked)

Programmer Humor

32380 readers
914 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] Phrodo_00 2 points 7 months ago (1 children)

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.

[โ€“] [email protected] 2 points 7 months ago

Yeah that's true, tzid is probably better than just a straight offset, that's probably what I was thinking but it was late when I posted lol. And the user moving is really more an issue of making updating that accessible imo