Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: DateTime Daylight savings question

by broomduster (Priest)
on Sep 19, 2008 at 19:45 UTC ( #712598=note: print w/replies, xml ) Need Help??

in reply to DateTime Daylight savings question

Works fine here on Mac OS X 10.4, NetBSD 3.1 and 4.0, and FreeBSD 6.2. The only thing I can think of is that the date is wrong, so maybe check that the date returned by DateTime->now is correct (print $dt->ymd, "\n";).

Replies are listed 'Best First'.
Re^2: DateTime Daylight savings question
by jsilva_im (Novice) on Sep 19, 2008 at 20:10 UTC
    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
      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".

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://712598]
[Corion]: stevieb: Yeah, but I don't follow guitar players enough... I never got Prince and I don't think I could recognize his play style. I can recognize Santana and Nile Rodgers, but that's about it, and not really deep knowledge I think ;)
[stevieb]: Jeff Healey cut of My guitar gently weeps
[stonecolddevin]: you don't recognize Prince. Prince tells you it's him.
[erix]: Alvin Lee (Ten Years After) played a jazzguitar ("Big Red"), a good warm sound
[stonecolddevin]: I think Stevie Ray is one of maybe 2 or 3 people that could take a Hendrix song and make you go "...huh. this is close." https://open. 0UVM9trirBK5s1xBwL oVhZ
[stonecolddevin]: https://open. 0UVM9trirBK5s1xBwL oVhZ rather
[Corion]: Sadly I must go to bed now :-| See y'all!
[erix]: I really loved/love this "Recorded Live" record, 1973 (yes, I'm that old)
[stonecolddevin]: goodnight Corion
[erix]: cya Corion :)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2017-06-22 21:33 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (531 votes). Check out past polls.