News for hackers. Stuff that matters.
Re:Fintech engineering mistakes by fatnoah on Wednesday June 28, 2023 @01:30PM (#36509706)
> Use ISO8601 date and time with offset info, always.

I think that's just sufficient for all use cases everywhere. I've been a software engineer for almost 25 years and, of all the universal truths I've encountered, implicit and unintended changes to datetime offset are the ones I've seen at every single job.

Re:Fintech engineering mistakes by SideburnsOfDoom on Wednesday June 28, 2023 @01:36PM (#36509808)
As I put in another comment, your class library might have a type that is equivalent to ISO 8601 data, indeed is convertible to and from it, but is a binary representation at runtime compatible with other types in the language.

So this technically isn't ISO8601, and certainly isn't "ISO8601 in a string", which is an _interchange format_ between application with potentially very different runtimes. I don't really recommend treating ISO8601 dates as mere strings, unless you intend to pass them through without even looking at the contents.

I refer to https://learn.microsoft.com/en-us/dotnet/api/system.datetime...

Use types that support ISO8601 with an offset, always.

Re:Fintech engineering mistakes by Terr_ on Wednesday June 28, 2023 @02:08PM (#36510280)
> I think [ISO8601 date and time with offset info is] sufficient for all use cases everywhere.

TLDR: Also, which timezone is used (not quite the same as offset) really does matter--UTC is great but you can't use it everywhere.

________

One of my favorite simple examples of this "here be dragons" for the new developer: Any system that schedules a future calendar-event.

Such events are typically pegged, implicitly if not explicitly, to a particular timezone or geographic context. For example: "The company's Virtual Summit will occur on November 2nd at 1PM Elbonian Xtreme Time, hosted out of our central Elbonian headquarters."

In that scenario, it is impossible to know for sure how many seconds-from-now it will happen until the moment actually happens. It's actually an indirect spec/contract for a future condition, one that automatically moves around if/when a nation/province/city declares their clocks must be set differently.

So if the Elbonian government changes their daylight-savings switchover to occur on November 1st instead of November 6th, the event just moved, and the the offset for the EXT time zone will change based on calendar-date. Even if you scheduled did everything UTC all along, now the summit is overlapping lunchtime for everyone in Elbonia.

Re:Fintech engineering mistakes by fatnoah on Wednesday June 28, 2023 @03:34PM (#36511467)
> TLDR: Also, which timezone is used

Good catch!

Re:Fintech engineering mistakes by SideburnsOfDoom on Wednesday June 28, 2023 @03:59PM (#36511785)
Absolutely, e.. an offset of +2:00 in e.g. 2023‐06‐28T18:00+02:00 could mean Berlin in the summer (Central European Summer Time, clocks will change) or in Johannesburg (South African Standard Time, not summer and clocks don't change). Same offset, different time zone, different clock change rules.

As you note, for some uses this _does_ make a difference and tracking which one you have can in these cases be important.

Re:Fintech engineering mistakes by prottog on Wednesday June 28, 2023 @04:50PM (#36512394)
> Elbonian Xtremesunshine Time

Ha, good one! One can only hope the Elbonian Parliament will have the sense to abolish this stupid Xtremesunshine time and observe one time zone year-round.

Re:Fintech engineering mistakes by Terr_ on Wednesday June 28, 2023 @05:58PM (#36513210)
I took an embarrassing number of minutes trying to pick a plausible /E.T/ code not already in use elsewhere, then gave up.