How to set a Time using the (internal) integer number?

Hi!

I am about to write a conversion tool from the datebook of my PDA
(Zaurus). I was relieved to notice, that Ruby is using the same
internal time as my PDA (seconds from 1970).

But I could not find out, how I can initiate a Time-object using the
integer number I get from the datebook?

e.g. I want to make Time.new(123456789)

hints?

···


Karl Voit

e.g. I want to make Time.new(123456789)

obsd% ruby -e 'a = Time.now.to_i; b = Time.at(a); p a,b'
1081692414
Sun Apr 11 16:06:54 CEST 2004
obsd%

Guy Decoux

Karl Voit wrote:

e.g. I want to make Time.new(123456789)

http://www.rubycentral.com/book/ref_c_time.html#Time.at

Regards,
Patrick