Archive for September, 2008
Leap Seconds
So, I noticed when my employer moved to a new web-server running (at the time) the most up-to-date version of mySQL and PHP there were some discrepancies with dates.
Then I realized something. For some reason when certain functions of the website posted things to the database that involved time, it was off. When the database entries did not have hours,minutes,seconds and just the date, it’d always push the date to be the previous day. This was strange and very annoying. You would post a news entry, and it’d be displayed as if it were posted the day previous. If you posted a sports schedule, the game listing would be off a day (this could cause definite issues).
After investigating this further, it turned out that database entries with hours,minutes,seconds did display the time as 23 seconds behind. Always 23 seconds. Always. This makes sense, because on date fields that don’t have the hourly time written, it’s internally notated as midnight (00:00:00). So, if you take 23 seconds away from midnight, it’s the previous day. What could cause this? PHP (the programming language that’s calling the data from the database) and mySQL is running off the same machine with the same clock, so it’s not like it’s desync’d.
After even further investigation, I traced down the issue. Apparently the international time committee decided to implement leap seconds in the UTC time standard. These leap seconds are implemented to compensate for the gradual slowing of the earth’s rotation due to the tidal effect. mySQL accounts for the leap seconds. PHP doesn’t. Or maybe vice versa. I don’t know. I would think if leap seconds are added, it’d be 23 seconds ahead. Perhaps I’m just thinking backwards about this.
Apparently these people don’t think of the consequences of their decisions in regards to hardware and software where time precision is required. Especially when midnight is used for the baseline in setting times. Right now I’m going to investigate the possibility of changing the mySQL timezone in favor of a “time standard” that doesn’t reflect leap seconds. Perhaps GMT-5. instead of UTC-6. Or whatever.
Regardless, this just shows why UTC should not be used when consistency is required.
I’m back.
So.
I’ve decided to start blogging again. I didn’t really stop for any particular reason. It was a combination of being busy and lazy.
I’m still working as a web engineer for a certain educational establishment. Been there since April of 2007. Things are going alright, but there is definitely room for improvement on that front.
Currently I am excited to play Spore. Spore is a game where you start as a single celled organism and you build up to a sentient creature, then to a tribe, then to a civilization, et cetera. No single run-through of the game will be the same as the previous. Other players’ creatures are asynchronously generated into your world. So basically, the other creatures you see were created by other players, it’s pretty cool. Also, the game keeps gameplay balanced so you’re not always ontop of the food chain. I’ve heard mixed reviews over it. It was awesome, it was over-hyped, it’s quite boring, it’s quite repetetive. But i think I am still going to check it out.
I’ve recently been experimenting with After Effects, a professional post-production video editting software package. You can do pretty awesome stuff with it, assuming you’re patient enough. I’ve done very minor stuff with it using free stock footage. What I want to do is make a lightsaber scene. I have the tools for that. The hard part is finding good piece of footage. What I would need is unrotoscoped footage with individuals holding a lightsaber hilt (handle) with a stand-in blade (not those plastic glowing ones) and the video should be of reasonable quality so I can actually tell where the stand-in blade starts and ends. I have someone who sent me about 30 seconds of un-editted footage from their fan-film. So I’m going to mess around with that. It won’t be anything special, but still kind of cool.
That’s it for now!