Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Re: Re: sorting mm/dd/yy

by royalanjr (Chaplain)
on Dec 15, 2000 at 20:41 UTC ( #46845=note: print w/replies, xml ) Need Help??

in reply to Re: Re: sorting mm/dd/yy
in thread sorting mm/dd/yy

That is what I have been doing at the moment. I use Time:ParseDate to turn the date into epoch and store that. Then when I need the formated into something a human can understand, I use localtime() to change it back.

Someone changed the time zone on the server and it knocked all the dates out of whack. I had to write a script to make up for the time zone hour shift to make the dates right.

Now, did I just do something bone-headed when I chose that scheme for the dates, or what?

Roy Alan

Replies are listed 'Best First'.
Re: Re: Re: Re: sorting mm/dd/yy
by Hrunting (Pilgrim) on Dec 15, 2000 at 21:46 UTC
    I may be wrong here, so umm, don't shoot me, but I believe that epoch timestamps are always given for UTC. Time::ParseDate does some manipulation depending on what your timezone, but there's a whole lot of options to tell T::PD how to handle the input time, so you could tell it that all dates being given to it are from a certain timezone (ie. before the date that you changed the timezone, tell T:PD to use one timezone, afterwords, tell it to use another) and that should pretty much straighten out any inconsistencies you have.

    I might be wrong about the epoch thing, but you can most certainly make up for shifts like that in T:PD itself.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://46845]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2021-01-17 13:38 GMT
Find Nodes?
    Voting Booth?