Elektrine lite

← Feed

@bert_hubert@fosstodon.org

Post #2239342

2025-01-17 21:58 UTC

"In Dublin's official timezone data, for example, tm_isdst is zero in their summer and one in their winter, the opposite of the norm, but not on RHEL, which "normalizes" the data. If you lived in Dublin and used Fedora, and made an invalid assumption about tm_isdst values, you would not be on time for tea." - from https://www.redhat.com/en/blog/brief-history-mktime

Replies (5)

  • @bert_hubert@fosstodon.org 2025-01-18 16:01

    I have finally found an up to date standard that covers mktime(), https://pubs.opengroup.org/onlinepubs/9799919799/functions/mktime.html - and in it we learn that on error mktime returns the valid timestamp -1 (which happened in 1969 UTC). To detect if this was an actual error, callers must set tm.tm_wday to -1, and check if after a call it is still -1. In that case, an error happened.

    Open ##2239343

  • @ColmDonoghue@mastodon.ie 2025-01-17 22:08

    @bert_hubert@fosstodon.org Ha ha! Would it surprise you to learn it was even more complex in Dublin before we had computers! There were 2 concurrent timezones here, depending on your politics for a while

    Open ##2239386

  • @derickr@phpc.social 2025-01-17 22:08

    @bert_hubert@fosstodon.org That's my fault! Ireland's standard time is UTC+1 (summer time) legally, and their DST jump is therefore -1 hour. I pointed that out on the tz list as an interesting fact, bit then they went ahead and actually encode it that way and that broke Java. https://github.com/eggert/tz/blob/master/europe#L369-L383

    Open ##2239388

  • @natural20@mastodon.ie 2025-01-17 23:01

    @bert_hubert@fosstodon.org Ah, timezones! And yeah, add in a dash of politics and software development, makes it all even more interesting!

    Open ##2239415

  • @nowster@fedi.nowster.me.uk 2025-01-18 16:49

    @bert_hubert@fosstodon.org Yes, by law Irish Standard Time (the default, and equivalent to BST and WEST) applies in summer and daylight savings of GMT applies in winter. Exactly the opposite of anywhere else.

    Open ##2239436