Harry Ohlsen wrote:

> Warren wrote:
> 
>> Hi,
>>
>> I have 1056030443784 (which is a time in millisecond) but I need this
>> time in the "normal" format like 2003-06-26 12:54.22
> 
> 
> Time has an "at" method that takes a number of seconds and returns a 
> time, so you could do something like ...
> 
>    ms = 1056030443784
> 
>    time = Time.at(ms / 1000)
> 
>    puts time
> 
> 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

> to get a more accurate time, if necessary.  Apologies if my arithmetic 
> is crap in the second example :-).
> 
> H.
> 
> 
> 


-- 
dc -e 
4dd*od3*dddn1-89danrn10-dan3+ann6*dan*2*an13dn1+dn2-dn3+5*ddan2/9+an13nap