this post was submitted on 05 May 2025
1235 points (99.5% liked)
Programmer Humor
23030 readers
1629 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Today I spent multiple hours trying to debug a timezone issue in a codebase. The timezone I was testing with was
Etc/GMT+4
, which I had assumed was four hours ahead of GMT. Turns out, itβs actually 4 hours behind GMT π€¦ββοΈGMT+4
would add 4 hours to Greenwich Mean Time though? That'sGET (Georgia Standard Time)
, so 10am (1000) GMT would be 2pm (1400) GET.GMT-4
would beEDT (Eastern Daylight Time)
, so that 10am (1000) GMT would be 6am (0600) EDT. Also, Georgia the state is in that time zone funny enough haha(For the most part. Timezones are really really complicated and you should probably just look up the offset for the specific city/region you want Everytime and use some other package for time stuff lol)
Yeah, you would've thought it would work that way. Regrettably, the standard timezone code of
Etc/GMT+4
is actually GMT-4. Wikipediahttps://en.wikipedia.org/wiki/Tz_database#Area
According to NIST, Eastern Time is UTC-4. And currently it is 5:04pm EDT, and in London (a city in GMT/UTC+0) it is 10:04pm. Which is 5 hours ahead (because America is dumb and has daylight savings).
Which is also backed up by your article.
Americas/Indianapolis
is the one I normally use since I'm in Indiana.Then the UK's equally dumb: it was 10:04 pm BST (GMT+1) cos daylight savings is a thing in most of Europe too. At least it's synchronised across Europe^[The EU is planning on killing daylight savings but I have no idea if the UK will do the sensible thing and go along when/if this happens] so you just need to remember that most^[thanks for making it more confusing, Mexico] of North America changes a few weeks earlier.
Also, the UK says GMT/BST which is nice and clear - calling both EST and EDT "Eastern Time" makes even more of a mess!
And yes, I've just rediscovered you can use footnotes, why do you ask?