Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^3: Converting local time to UTC mystery

by ikegami (Pope)
on Sep 05, 2011 at 16:26 UTC ( #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 (Pope) 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 <>
        «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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://924272]
[markong]: ahah thanks Corion :)
[Eily]: Discipulus usually it's while testing that you want the full logs :)
[Eily]: anyway, maybe you can ignore STDERR ? (I'm not sure about @CARP_NOT, it looks like it only changes the place the error comes from)
[markong]: " Perl: the Markov chain saw" :D aha
[Discipulus]: thanks 1nickt but seems i'm not able to use it correctly...
[Discipulus]: Eily i'm testing a failure: i ok if i get bad results.. perhaps there is another way to do it...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2018-01-22 11:26 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (233 votes). Check out past polls.