Ruby code

Sep 26, 2005 12:53

I wrote my first actual piece of Ruby code, recently. My watch has (as well as the usual hands) a hand that makes one sweep every 24 hours, and is currently set to London time (BST, at present, but for the sake of argument, I am considering it as GMT / Zulu time). I was curious as to when it and the normal hour hand would line up, and as I was in ( Read more... )

geeky, watch, code, ruby

Leave a comment

mollyemo September 26 2005, 18:10:31 UTC
I think it's once a day, 1400 BST and 7am EST. The once a day seems obvious enough, but I'm not terribly sure about the time...

Reply

wmute September 26 2005, 18:15:36 UTC
You're certainly on the right track - except that the difference between EST and BST (or between EDT and GMT, as I'm approximating it - I should have done this in the winter, really) is 5 hours, not 7. But other than that, you're getting there.

Reply

mollyemo September 26 2005, 18:19:16 UTC
Stupid military time confusing me. Never ask me to use a 12-hour and 24-hour clock at the same time ;-)

Is it 1000 and 5am, then?

Reply

wmute September 26 2005, 18:36:07 UTC
It is.

More generally, it will be when the time since local midnight is equal to the amount of time you are behind GMT. For example, Moscow is +0300, which means that GMT is 21 hours ahead (as we aren't concerned with dates), so that 21:00 (9pm) in Moscow is 18:00 in London.

In essence, if the local clock begins at midnight, the GMT clock begins x hours ahead, but then advances at half the rate of the local clock, so that after an additional x hours, the local hour hand shows x o'clock, and the GMT hand shows 2x o'clock, which puts them at the same location.

I hope that makes sense. It does in my mind, but I'm not sure I've explained well.

Reply

monkeyman13 September 29 2005, 19:35:36 UTC
I worked out almost exactly this explanation in my head before reading the comments, and of course, came to the right answer.

I'm kind of proud of myself for doing so, which is maybe a sad commentary on the efficiency of my brain these days. :-)

Reply


Leave a comment

Up