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

Programmer Humor

32162 readers
658 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
[–] azvasKvklenko@sh.itjust.works 16 points 3 months ago (4 children)

It’s only bad when used incorrectly. Just store time in UTC and convert it to timezone of your setting to present it. Most modern languages offer a library that makes it just one more line of code. Not only it’s then clear and unambiguous, it supports all timezones.

[–] dvlsg@lemmy.world 6 points 3 months ago (1 children)

Doesn't always work, especially if you need to work with any sort of calendar or recurring schedule.

[–] booly@sh.itjust.works 3 points 3 months ago

Yeah, timestamps should always be stored in UTC, but actual planning of anything needs to be conscious of local time zones, including daylight savings. Coming up with a description of when a place is open in local time might be simple when described in local time but clunkier in UTC when accounting for daylight savings, local holidays, etc.

load more comments (2 replies)