Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime CPAN distribution.

Report information
The Basics
Id: 93681
Status: resolved
Priority: 0/
Queue: DateTime

People
Owner: Nobody in particular
Requestors: jaryd [...] jaryd.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: problem with is_dst?
Date: Sun, 09 Mar 2014 11:53:36 -0500
To: bug-DateTime [...] rt.cpan.org
From: Jaryd Malbin <jaryd [...] jaryd.org>
It is currently daylight savings time in the United States. However, when I run $dt->is_dst(); it returns "0" indicating that we are currently not in DST. i would expect this to return "1" Thanks! Jaryd
On Sun Mar 09 12:53:46 2014, jaryd@jaryd.org wrote: Show quoted text
> It is currently daylight savings time in the United States. However, > when I run > > > > $dt->is_dst(); > > > > it returns "0" indicating that we are currently not in DST. i would > expect this to return "1"
You haven't given me enough info to answer this question. How did you make this object? My psychic powers are on the fritz these days. However, if I had to guess, I'd say you did "DateTime->now", which returns an object in the UTC time zone. You need to write "DateTime->now( time_zone => 'local' )" if you want it in your local time zone.
Subject: Re: [rt.cpan.org #93681] problem with is_dst?
Date: Sun, 09 Mar 2014 16:29:46 -0500
To: Dave Rolsky via RT <bug-DateTime [...] rt.cpan.org>
From: Jaryd Malbin <jaryd [...] jaryd.org>
Woops! Sorry about that Dave! Despite the minimal information I think you may have solved my issue... It looks like your psychic powers are functioning after all :) -- Jaryd Malbin jaryd@jaryd.org On Sun, Mar 9, 2014, at 12:24, Dave Rolsky via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=93681 > > > On Sun Mar 09 12:53:46 2014, jaryd@jaryd.org wrote:
> > It is currently daylight savings time in the United States. However, > > when I run > > > > > > > > $dt->is_dst(); > > > > > > > > it returns "0" indicating that we are currently not in DST. i would > > expect this to return "1"
> > You haven't given me enough info to answer this question. How did you > make this object? My psychic powers are on the fritz these days. > > However, if I had to guess, I'd say you did "DateTime->now", which > returns an object in the UTC time zone. You need to write "DateTime->now( > time_zone => 'local' )" if you want it in your local time zone.