Problem converting a System Time to DateTime

M

Marc Howell

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
 
M

Marc

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top