this post was submitted on 01 Dec 2023
334 points (98.0% liked)

Programmer Humor

35867 readers
418 users here now

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

Rules:

founded 5 years ago
MODERATORS
 

I know this isn't any kind of surprise, and yet, well...

you are viewing a single comment's thread
view the rest of the comments
[–] projectmoon@lemm.ee 8 points 2 years ago (1 children)

But wouldn't you calculate the time in the future in the right time zone and then store it back as UTC?

[–] 48954246@lemmy.world 1 points 2 years ago (1 children)

It depends on the application.

I don't remember all the specifics but this is the blog post I refer to when this topic comes up

https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bullet/

[–] magic_lobster_party@kbin.social 5 points 2 years ago

So TL;DR: there might be unexpected time zone rule changes in the future. The solution presented in the article is to store both UTC and local time, so the application can easily adjust itself if such change happens.