Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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 ;)


hth,
PooLpi

'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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://741219]
help
Chatterbox?
[LanX]: hey I was told yesterday that "Alma Ata" means father of the apple (ex capital of Kazakhstan) ... so alma is Turkish
[Discipulus]: good point: alms ~charity I made a varronian etymology, sorry, from Alma ~soul
[erix]: alms, aalmoes, almosen from greek eleēmosúnē
[Discipulus]: Almosen is Elemosina in Eatalian
[erix]: yeah, you mediteraaneans are one big family :)
[Discipulus]: greece had to copyrigth etymologies to fill the debt..
[erix]: good no-nonsense american approach to these soft european practices: "Upon entering the Almshouses in Connecticut, patients were whipped up to 10 times"
Discipulus should have..
[erix]: the almshouse generally seems to have become an anglosaxon relic :P
[Discipulus]: just to be sure was not for a free lunch.. sbaaam!

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2017-11-23 20:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (338 votes). Check out past polls.

    Notices?