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

Re^2: DateTime Daylight savings question

by jsilva_im (Novice)
on Sep 19, 2008 at 20:10 UTC ( #712612=note: print w/ replies, xml ) Need Help??


in reply to Re: DateTime Daylight savings question
in thread DateTime Daylight savings question

I get the proper date with that, but the time is still off.

$dt = DateTime->now; # same as ( epoch => time() ) $dt->set_time_zone( 'America/New_York' ); print "\n Now:".$dt->hms; print "\n YMD: ".$dt->ymd; #returns: # Now:17:15:48 # YMD: 2008-09-19


Comment on Re^2: DateTime Daylight savings question
Download Code
Re^3: DateTime Daylight savings question
by broomduster (Priest) on Sep 19, 2008 at 20:56 UTC
    Curious... That time isn't even Standard Time for America/New_York at the moment. I have PM display times in my local time zone (currently EDT, same as America/New_York at the moment). That tells me that your reply was posted at 2008-09-19 16:10:07 EDT, which would be 15:10:07 EST, yet you show 17:15:48 from DateTime->now. That's about an hour off, but it's in the wrong direction.

    What does Windows think your time is (and might as well check it's notion of the time zone, too)? I'm stretching here; I don't have a Windows system that I can use to check this.

    Update:One other thing that might be worth checking:

    my $isdst = ( localtime(time) )[-1]; print "$isdst\n";
      That routine returned a big "0".
        $isdst = 0 means your system time is not set to DST.

        Update: ikegami is doing a better job below explaining what I was trying to get at above.... Namely, your system time settings appear to be off.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-12-25 05:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls