in reply to unix epoch date

Check out the built in localtime(). It takes an epoch seconds arguement, and returns an array consisting of various date / time parts. Depending on your calculations, the breakdown returned by localtime() can make the calculations easy.

Replies are listed 'Best First'.
Re: Re: unix epoch date
by Anonymous Monk on Aug 08, 2003 at 16:18 UTC
    Yer, I've been working through that today, however I can't work out how I can translate 12272 as being today, if I user localtime I make today 1062975600 !!!
      A day is 24 hours with 60 minutes with 60 seconds each.
      perl -le 'print time() / (24*60*60)'
      Alternatively,
      perl -le 'print scalar localtime( 12272 * 24*60*60 )' perl -le 'print scalar gmtime( 12272 * 24*60*60 )'

      --
      [ e d @ h a l l e y . c c ]

        A day is 24 hours with 60 minutes with 60 seconds each.
        Well - *most* days...:)

        Ben.

        Excellent, thanks for the help . .

        Rich

      Where do you get 12272 from? is there some code snippet that is causing trouble, i need to know more of whats going on.
      sorry I meant if I use localtime(). . .