In 2012, I submitted a Python bug about the bad state of ISO 8601 date parsing in Python. It's still open, after four years of arguments.[1] [1] https://bugs.python.org/issue15873
For those who perhaps don't use Python: what makes this more ridiculous is that Python can output ISO timestamps. But it cannot read them back in. Thankfully, there are third party libraries that do just this (such as iso8601), but its such a silly dependency to need.
Falsehoods programmers believe about time and time zones
41–50 of 83 posts
Re: Falsehoods programmers believe about time and time zones
#42Re: Falsehoods programmers believe about time and time zones
#43I hope http://momentjs.com/ is not one of libraries that falls into "Many people write libraries without knowing much about the domain." I have used it many times and it is the best one I have come across. Timezones conversion is super hard, which is the exact reason I rely on libraries rather than trying to reinvent the wheel.
Re: Falsehoods programmers believe about time and time zones
#44Earlier quoted context omitted.
For those who perhaps don't use Python: what makes this more ridiculous is that Python can output ISO timestamps. But it cannot read them back in. Thankfully, there are third party libraries that do just this (such as iso8601), but its such a silly dependency to need.
Yes, there are at least six such libraries, and most, if not all, of them have bugs. Different bugs.
Re: Falsehoods programmers believe about time and time zones
#45Days don't always start at midnight.
Midnight might not exist--some countries perform their DST transition at midnight, so the clock goes from 11:59 PM to 1:00 AM. Fun stuff!
Re: Falsehoods programmers believe about time and time zones
#46Earlier quoted context omitted.
> It bothers me that a minute is not always 60 seconds. For leap seconds why did we choose 23:59:60 instead of 24:00:00? But how does this solve the problem? Sure, 23:59 is now 60 seconds long, but the minute 24:00 is only 1 second long.
It's about consistency. 23:59:60 is introducing a special case to the seconds field which you have to account for. 24:00:00 only adds a second to the day where it naturally should go. I don't redefine what a minute is, a minute is always 60 seconds. You are confusing two separate ideas, displaying a time and finding the difference between two times. Lexically you wouldn't say that minute is 1 second long, you would s…
Re: Falsehoods programmers believe about time and time zones
#47Would it be too much to have a global movement for uniform time standards? No half-hour timezones, no daylight savings, no leap seconds, just easily predictable time. Calendars are supposed to be convenient, and right now our ancient conventions make it difficult to understand each other (not just computers; think of travelers having to adjust to timezones, "do I need DST or not?"). At least, lets think of the electr…
"So you want to abolish time zones" https://qntm.org/abolish
>We already do have a global standard time zone, and everybody who cares already uses it: UTC. There are also more accurate time standards in use for more specialist purposes.
"You advocate a ________ approach to calendar reform" https://qntm.org/calendar
These links helped convince me that while time zones and calendar systems are very messy, there are some inherent reasons why they are messy.
Re: Falsehoods programmers believe about time and time zones
#48One of the more interesting bugs I've created is in an Elixir program using the (great) Timex[0] library. I realised that for a few particular users, timezones were being inverted when converted (e.g. a user in GMT+5 would behave as if they were in GMT-5 and vice versa). After a lot of time spent proving to myself I was not actually going mad, I opened a Github issue and the library author informed me about one of th…
I'm curious: Why where you using e.g. GMT+5 or GMT-5?
Re: Falsehoods programmers believe about time and time zones
#49Dealing with timezones and daylight savings time has consumed hundreds of hours of my development time. This seriously should be a standard service of the operating system, not the programming language library. Just look at all the code to deal with it in D (written by Jonathan Davis): https://github.com/dlang/phobos/blob/master/std/datetime.d
Re: Falsehoods programmers believe about time and time zones
#50My bete noir isn't in the list: GMT is only the UK timezone for about half the year. During the Summer, GMT continues to exist, but the UK time is BST.
"CST is also used for: Cuba Summer Time, China Time, Central Standard Time (Australia). PST is used for Pakistan Standard Time and Pacific Standard Time. If you want a unique identifier for the time zone in the Pacific West of the USA it looks like this: “America/Los_Angeles”."
In this case the name of the time zone "people live in" is "Europe/London", not GMT.