Problem converting a System Time to DateTime

Discussion in 'Ruby' started by Marc Howell, Dec 18, 2008.

  1. Marc Howell

    Marc Howell Guest

    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
    Marc Howell, Dec 18, 2008
    #1
    1. Advertising

  2. Marc Howell

    Marc Guest

    On Dec 18, 2:50=A0pm, "Marc Howell" <> 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
    Marc, Dec 18, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    685
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  2. Tim Peters
    Replies:
    0
    Views:
    518
    Tim Peters
    Sep 9, 2003
  3. mp
    Replies:
    1
    Views:
    372
    John Machin
    Jul 28, 2006
  4. Martin
    Replies:
    0
    Views:
    325
    Martin
    Dec 27, 2008
  5. Replies:
    2
    Views:
    741
    M.-A. Lemburg
    Jan 6, 2009
Loading...

Share This Page