Linux® Time

So let’s talk about Linux® and time again. We’ve talked about the calendar, we’ve talked about the Network Time Protocol, but let’s talk about how Linux® stores it.

Everyone seems to have their own way they want to write the date. In Europe, they like to lis t the date first but in America, they like to list the month first. Some people even like to list the year first. And that’s just the date. Now there’s the time! There is the standard of hour, minute, second, but what if you want to write year, hour, month, minute, day, and then seconds? There’s no reason you shouldn’t, right?

Well, keeping track of all of those choices isn’t something Linux® should have to do. Instead, it keeps time by counting seconds, and you can take those seconds and make them look however you want.

Linux® had to start counting seconds at some point, and they chose to start at January 1, 1970.  That’s weird, right?  Linux® wasn’t released until 1991, why did they choose 1970?

Well, I could spin an awesome story about how that’s the instant the first real computer was turned on, or that Iron Man first turned his suit on, or Batman decreed it to be the start of the new era (or new new era), but that would be wrong. The real story isn’t that it’s the birthday of Unix (the Operating System that Linux® mimics), the real story is that it looked pretty.

Computers used to keep time on the sixteenth of a second. This caused problems, because that meant the computer could only tell time for a couple of years before it couldn’t store it anymore. The decision was made that ‘gee, we should use seconds, that’ll work better’. (There was more discussion about this. Imagine the Avengers and the Justice League trying to agree on something.) Once that decision was made, they said ‘huh. Well, let’s start counting from January 1, 1970. That’s a nice round time. Even though it’s 1972 now, that’ll work great’.

And so that’s what they did, they started counting from January 1, 1970.  All Linux® time is stored like that, it just prints out the pretty time (in the format you want).    Check out the man page for date, it will tell you how.

Leave a Reply

Your email address will not be published. Required fields are marked *