[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problem converting a System Time to DateTime

Marc Howell

12/18/2008 12:51:00 PM

Hi All

I am new to Ruby and working on a project which needs to read a
SystemTime (milliseconds from 1 Jan 1970) from an xml file and convert
it to a DateTime.

Unfortunately I cant seem to find any method for doing so in either
the Date or Time classes. Does such a function exist? If not, is there
any other way to do this?

Thanks for you help
Marc

1 Answer

Marc Howell

12/18/2008 1:02:00 PM

0

On Dec 18, 2:50=A0pm, "Marc Howell" <darklin...@gmail.com> wrote:
> Hi All
>
> I am new to Ruby and working on a project which needs to read a
> SystemTime (milliseconds from 1 Jan 1970) from an xml file and convert
> it to a DateTime.
>
> Unfortunately I cant seem to find any method for doing so in either
> the Date or Time classes. Does such a function exist? If not, is there
> any other way to do this?
>
> Thanks for you help
> Marc

Of course once I have clicked send, I find the solution imediately.

Time.at wasnt working because one of my Unix Times was corrupt, of
course it was the very first one so I never realised the rest of them
were working since it bombed out with a Bignum error on the very first
conversion.

Thanks anyway
Marc