You think time has some weird edge cases, but then you get into a discussion about cultural appropriation and you realize how lucky you are to only be worrying about calendars.
I used the word "appropriating" but I wasn't talking about cultural appropriation.
I quote: "appropriating rap culture"
I must admit to failing to see the distinction between appropriating culture and cultural appropriation.
Postgres have done a really good job here. It not only understands offsets (which most devs think are timezones) it also understands timezones. What's the difference?
GMT-8 is an offset.
America/New_York is a timezone.
This becomes important when you want to schedule a meeting on the east coast of the USA in April - Europe and the US change DST on different dates. But if you tell postgres you want a time in a particular zone it will do the calculation correctly. If you use an offset you might turn up an hour late.
This is tougher to get then time in general relativity...
I always figured if spacetime was relative, why don't we just report the location we are at and that local time? If I know I was in Lower Manhattan at 2:00pm on November 19th, 2007, somebody else can just do a little math to figure out when that actually was compared to their own local time and place. All times are interpretive. UTC just seems like a giant hack to try to avoid the interpretation.
In my 20 years of working with software and distributed architectures, no problems have been harder than working with time zones and calendars. It is truly nightmarish stuff. I am convinced you could run a very profitable consultancy specializing in debugging date and time related problems in people's systems.
That would be profitable, but I'm not convinced anyone could stomach that job without going insane. Maybe a year if you were extremely hardy, but I'd be running for the padded cell after 3 months of dealing with nothing else.
> Properly storing timezone-aware times I'd just like to point out that a lot of RDBMSs support storing date and time alongside timezone information directly without using two separate fields. SQL Server has datetimeoffset, PostgreSQL has timestamp with time zone, and Oracle has timestamp with time zone. I think MySQL does as well, but I seem to recall something strange about it. Or maybe that's just me expecting MyS…
Erp. This sentence made me wince. Times don't have timezones - places have timezones. The idea that time handling is made easier by attaching timezones to times is the cause of so many headaches. Correct time handling involves understanding place - the place where things happen, the place where the user is observing them from, the place where a clock displays a particular time.
I would be interested to see a proposal for a standard for establishing planetary time with the feature that you can easily convert from one planet to the other, but I have no idea how you would do that. What happens when we move to Mars with Elon? UTC would not be practical.
So the article seems to imply you should store all timestamps as UTC (with an additional timezone string ID). But for events in the future that needs to happen on a specific "wall clock point in time", it might be better to actually store the yyyy-mm-dd hh:mm:ss as a string with a timezone next to it, because timezones can and do change often unpredictably. If you pre-calculate what "4.00pm next August 1st" is as a U…
Sadly I didn't have enough time to read the whole article... But I wish we could all just use one time. For some, midday would be 12, and for others it might be 19, but we already all use the same dates regardless of whether February is winter for one location or summer for another.
We don't - and in fact can't use the same dates, though. Right now, where I am, it's still Tuesday, May 29 - but in Europe, at this very same moment, it's already May 30 - a Wednesday. Maybe you would argue that we force everyone to run their days midnight to midnight on the same calendar - so instead, I would run on the European calendar, and my workday would have begun on May 29, but ended May 30. I guess today was a Tue-wednes-day? That's all very well, except now we have the weird situation of the US workweek running from Montueday through to Frisatday - while the Australian workweek, if they followed the same approach, would go from Sunmonday through to Thufriday.
So the article seems to imply you should store all timestamps as UTC (with an additional timezone string ID). But for events in the future that needs to happen on a specific "wall clock point in time", it might be better to actually store the yyyy-mm-dd hh:mm:ss as a string with a timezone next to it, because timezones can and do change often unpredictably. If you pre-calculate what "4.00pm next August 1st" is as a U…
There is a solution for this, Unix timestamps.
Looks like someone didn't read the article :) If you normalize to UTC for some future date with a timezone in Lower Left Elbonia Standard Time (GMT+7:42), and the Elbonian Revolutionary Army successfully form an overnight junta, retroactively declaring the country's timezone to be Free Peoples' Elbonia Revolutionary Time (GMT-12:00), suddenly your DB rows make no sense whatsoever.
The absolute point in time relied on future knowledge that did not yet exist, that invalidated any previous estimate of when it would occur. An external timezone reference (the Olsen DB) must be continually updated and separately referenced