Lies programmers believe about calendars

And just don’t even think about doing time zones on your own:

The good thing about timezones: it’s always pub o’clock somewhere.

2 Likes

Want is probably too strong of a word, interested in is probably better. But yes, 5pm occurs at the same time everywhere in the world, instead of occurring some 30+ times over the course of 24 hours.

I tried to make this point in an earlier reply, I feel that the technological level where time zones are the best solution is a blip in our history.
Also our current time zones are only loosely connected to solar time, much of the worlds time zones already skew away from true noon being near the center of the time zone’s region, for many of them it’s on the eastern edge, or in some cases outside the eastern border. And that is before summer time which can shift it even more.

Except that the French Republican Calendar is entirely incompatible with any current time keeping system. A single world time zone would largely represent a change in nomenclature and little else, time would not be kept or measured any differently. It wouldn’t even need to be done all at once, if it was decided that the single time zone should be UTC then any nation or region could change their official time to UTC, if others followed it would become the common time.

To a programmer who isn’t writing the underlying OS-level calendaring system, timezones are effectively just named offsets. And you don’t really need to know the names. Or the offset really.

Most programming tasks are like: give me the date and wall-time 9 days, 12 hours, 36 minutes, 5 seconds, and 20 milliseconds from now, and present to an international user anywhere on the planet. So simply convert 9d12h36… etc. to some interval in seconds, and add it to the absolute time of now which is typically UTC. If you’re displaying this date on a website in a user’s local time, you’d go through some package which would fetch the user’s current time zone and then add or subtract the offset, and then format it nicely.

If you are writing the calendaring system yourself, then timezones are more than an offset – they’re a headache, because you’ve got deal with geo-politics: layout of borders, special USELESS TIME SHIFTS like Daylight Saving’s Time, and all of the corresponding special rules and exceptions, in addition to understanding how to format dates and times and parse input etc. for regional and cultural and sometimes religious differences from the western calendar. I don’t wear hats because they’re always going off to people who specialize in things like that.

This topic was automatically closed after 5 days. New replies are no longer allowed.