Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^3: convert local time to unix epoch time

by poolpi (Hermit)
on Feb 04, 2009 at 08:51 UTC ( #741219=note: print w/replies, xml ) Need Help??

in reply to Re^2: convert local time to unix epoch time
in thread convert local time to unix epoch time

From DateTime doc:

The time_zone parameter can be either a scalar or a DateTime::TimeZone object. A string will simply be passed to the DateTime::TimeZone->new method as its "name" parameter. This string may be an Olson DB time zone name ("America/Chicago"), an offset string ("+0630"), or the words "floating" or "local". See the DateTime::TimeZone documentation for more details.

From DateTime::TimeZone :

If the "name" parameter is "local", then the module attempts to determine the local time zone for the system.
If a local time zone is not found, then an exception will be thrown.

...For me, at least, it throws actually an exception ;)


'Ebry haffa hoe hab im tik a bush'. Jamaican proverb
  • Comment on Re^3: convert local time to unix epoch time

Replies are listed 'Best First'.
Re^4: convert local time to unix epoch time
by ikegami (Pope) on Feb 04, 2009 at 13:39 UTC

    Then you should have answered the OP and explained that it doesn't work for you before giving the workaround for your system and passing it off the solution.

    Note that it works fine for me on the Windows and linux systems on which I tried it.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://741219]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2018-06-18 04:56 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (108 votes). Check out past polls.