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

Re^3: Converting local time to UTC mystery

by ikegami (Patriarch)
on Sep 05, 2011 at 16:26 UTC ( [id://924272]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Converting local time to UTC mystery
in thread Converting local time to UTC mystery

I would need to find out how much I am away from UTC.

...which changes during the year, making it that much more difficult. Yeah, hardcoding offsets is not the way to go.

  • Comment on Re^3: Converting local time to UTC mystery

Replies are listed 'Best First'.
Re^4: Converting local time to UTC mystery
by ikegami (Patriarch) on Sep 06, 2011 at 00:48 UTC
    That said, '+0200' can be replaced with 'local'
      Indeed this works, thanks a lot!!! I wonder, where this is documented...

      For completeness, here the working function call:

      my $seconds_since_epoch=str2time($timestamp_local, 'local');

      -- 
      Ronald Fischer <ynnor@mm.st>
        «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.»

Log In?
Username:
Password:

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

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

    No recent polls found