Time is relative, mostly universal but never standard

I’ve been having some adventures with time the last days. But not the time traveling kind, nor the time saving tips. Something more banal. Trying to get a timestamp generated by the backend being understood by a smartphone app.

The arbitrary of the system of reference for time that we use is something we usually don’t even think about. After all there is also the Chinese calendar, the Jewish calendar and even the Mayan calendar. But for some reason a religion decided to take the winter solstice and make it a reference point, and we all follow suit. Never mind that they didn’t have the leap year correction under control and that their official celebration date moved 4 days to the 25th until they corrected it. And it took 10 full days of drift for our official calendar to catch up.

But when it comes to computers there are also many calendars going around. I was happily working on the back end and decided to use their “Windows time”. My embedded background makes me shiver at storing a timestamp as a string, so I was happily using the 64 bit Double that the calls were giving back.

And then the back-end and front-end time worlds collided…

As you can see from this table in Wikipedia, every operating system invented their own “time reference point”. Windows happens to keep the time as the number of 100 nanoseconds since the 1. of January of 1601. W.T.F? Why 1600? why 100 nanoseconds?

The iOS world is not much better. They keep the time as a double, and their origin is the 1. 1. 2001. Their time takes negative values so they pretty much have it covered for the next 10,000 years. And since we know that agriculture is about 10,000 years old it is highly that they can resolve any date that might be found in a history book.

However, you do need to find a common point to get time stamps converted back and forth. And here is where the Unix time comes in handy. The 1. of January of 1970. Microsoft couldn’t care less about the iPhone time, and Apple does not give a rat’s tail about windows flirt with renaissance. But they both talk to grandpa Unix, and its younger version Linux. So, my timestamps are now handily kept in seconds since the 1.1.1970

But if you think you have seen it all when it comes to time, let me show you another timestamp:

Wed Aug 27 13:08:45 +0000 2008

Yes, somebody at Twitter decided to be different and moved the year to the end to their text representation of their timestamp. I bet that there is someone out there with a wide grins counting developers that smash half an hour of their time to fire up the debugger and sort out the format. They somehow had to even out all the good they did when they released bootstrap (Their CSS library for responsive web page design)

An interesting trivia. Did you know that Linus Torvalds was born on the 28th of December of 1969? just 3 days before “Linux time zero”…

Will a future AI based archeology system decide that Linus birthday is the real reason for the reference point of Linux time?

And since we are on a trivia spree. Did you know that a bit less than a billion and a half seconds have ticked since that date? I think I will move away from celebrating birthday and start celebrating billions of seconds…

Picture courtesy of Ines Zgonc (CC-SA) found in wikimedia commons, where you can also find some of my photos

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.