this post was submitted on 29 Jun 2024
880 points (94.9% liked)

Programmer Humor

31250 readers
2624 users here now

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

Rules:

founded 4 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] MrScruff@lemmy.ml 2 points 6 days ago (1 children)

Depends on what's collecting the information. If it's a website, then the client-side code could most certainly normalize everything to UTC based on the browsers time zone before submitting. That's what I would probably do, if the user's time zone isn't needed or wanted..

[โ€“] SpaceCowboy@lemmy.ca 2 points 6 days ago

This is actually the best approach.

Obviously they are getting timezone information otherwise the app could only display whatever time the user entered in.

If you want to sort things by the actual time, it's simple and performant if all of the times are in the same timezone, and UTC would be the standard one to use. Pushing the timezone calculations to the client makes sense because the UTC time is correct, it's just a matter of displaying it in a user friendly way, ie. show the time in the user's timezone.