Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Difficult on use time

by Marshall (Prior)
on Apr 08, 2012 at 04:48 UTC ( #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.


Comment on Re: Difficult on use time
Re^2: Difficult on use time
by exilepanda (Monk) 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
Node Status?
node history
Node Type: note [id://963968]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-09-16 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (17 votes), past polls