Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Difficult on use time

by Marshall (Canon)
on Apr 08, 2012 at 04:48 UTC ( [id://963968]=note: print w/replies, xml ) Need Help??


in reply to Difficult on use time

My advice is to log everything in GMT (UTC) and use GMT for all of your calculations. Standardize upon that. Use one of the Date/Time modules to convert to local time for presentation.

if I hard code the conversion, I lost the portability if the system moves to other time zone.
store all the data as UTC, convert when necessary for user presentation.

Replies are listed 'Best First'.
Re^2: Difficult on use time
by exilepanda (Friar) on Apr 08, 2012 at 17:31 UTC
    Thanks for the advise! For my development scope, I don't see the necessity to maintain 2 time manner. I could change my system timezone for this situation as last resort. As I do not need the timezone auto convert in this way. However, I am looking if there's any Perl way can do this.

    For more real case, I do not hesitate to do the conversation, but rather reserve the timezone for public users' own tz for their own location( not my system ). Writing log or so is just one example, out of many scenarios.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-19 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found