From: Harry Ohlsen Date: 2003-07-01T19:41:58+09:00 Subject: Re: Millisecond in time. Anders Borch wrote: >> It also takes a number of microseconds as a second argument, so you >> could also do >> >> time = Time.at(ms / 1000, (ms % 1000) * 1000) > > > wouldn't that be > > time = Time.at(ms / 1000, ms % 1000) > > '%' returns the fraction part *as an integer* iirc Yes, but the second argument to Time#at is in microseconds. Since the original value was milliseconds, taking it mod 1000 gives us just the leftover milliseconds (ie, the ones that don't add up to a multiple of a second). We then need to multiply that by 1000, since microseconds are 1000 times smaller than milliseconds. Or is my logic still screwed up? As I said, my arithmetic is terrible :-).