Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: Re: setting TZ causes Date::Manip to report incorrect time

by autarch (Hermit)
on Sep 09, 2003 at 19:56 UTC ( [id://290149]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: setting TZ causes Date::Manip to report incorrect time
in thread setting TZ causes Date::Manip to report incorrect time

Valid values for the TZ variable when using DateTime are anything that matches a valid Olson time zone name, like "America/Chicago". When using Date::Manip they're whatever the Date::Manip docs say are valid. See the "TIMEZONES" section of the docs.

Why did Date::Manip behave as you described? Presumably there's a bug in Date::Manip, or your expectations are wrong and Date::Manip can't do what you want.

How often do you need to parse things like "today" and "two days after tomorrow" anyway? With DateTime, for just getting "today" you'd do DateTime->today(). To format it as above you'd do $dt->strftime('%a %b %e %H:%M:%S %Z %Y'). However, you're strongly discouraged from using short time zone names like "PDT" for anything but display, because they are not unique.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2024-04-23 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found