Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: why are timegm and timelocal returning the same epoch seconds values

by karlgoethebier (Curate)
on May 15, 2013 at 10:55 UTC ( #1033661=note: print w/ replies, xml ) Need Help??


in reply to Re: why are timegm and timelocal returning the same epoch seconds values
in thread why are timegm and timelocal returning the same epoch seconds values

Update2:

use DateTime; use DateTime::TimeZone; my $dt = DateTime->new( year => 2013, month => 4, day => 15, hour => 12, minute => 45, second => 47, time_zone => 'Europe/Berlin', ); my $tz = DateTime::TimeZone->new( name => 'US/Pacific' ); my $offset = $tz->offset_for_datetime($dt); print qq($offset\n); print DateTime::TimeZone->offset_as_string( $offset ) . qq(\n); print qq($dt->hour\n); $dt->set_time_zone( 'US/Pacific' ); print qq($dt->hour\n);

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»


Comment on Re^2: why are timegm and timelocal returning the same epoch seconds values
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-09-20 15:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls