Thursday, September 14, 2006

Military time.

I have a cheap casio digital watch that looks like it's from the 80's or something. I have a laptop computer running the Gentoo distro of the GNU/Linux operating system.

Skip the indented parts

I set the watch by the time on my cell phone and it doesn't drift much - so I trust that it is pretty accurate. The time on the laptop was off by about 20 minutes - I'm not sure why, but I think that it might have something to do with thermal overload and the processor's method of handling this (throttling back to reduce power usage and heat output) which the OS might not be configured to handle correctly. Linux doesn't use the hardware clock while it is running - it reads from it at boot and then keeps track of the time on its own - then it (optionally) resets the hardware clock at shutdown. If the processor clockrate changes and linux isn't fully aware of this then the time could potentially get messed up. I think this might be what happened.

Or I might have simply set the clock to the wrong time when I reset it to MST because I was guessing.


So I had to fix the time. The linux date command, which sets the time and date, takes the time in military time format.

I glanced at my watch to see what time it is - it's 7:10. Now to convert this to military time... hmm add 12... it's 19:10 - I had to do this all in my head and, being a bit distracted and stressed from work and all, it took me a second.

date 0914191006


that's the command I then issued the format is MMDDhhmmYY (month day hour minute year)


Two minutes later, I glanced at my watch - it had been set to military time! I had subconsciously converted from military time to normal time only to have to convert back for the date command.

My watch has a button on the side closer to my hand that switches from military time to normal time - I'm always hitting this button accidentally, so I've developed the ability to convert to normal time subconsciously. I guess I haven't developed the ability to perform the referse conversion subconsciously

0 Comments:

Post a Comment

<< Home