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: 20787
Status: rejected
Priority: 0/
Queue: DateTime

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

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



DateTime objects seem to ignore my DST (GMT, 1 Auguest). Thus DateTime gives the wrong time for about half the year. bash-3.00# perl -V Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=linux, osvers=2.6.12.6-xen3_12.1_rhel4.1, archname=i686- linux uname='linux rnddev 2.6.12.6-xen3_12.1_rhel4.1 #1 smp tue jan 31 14:04:08 pst 2006 i686 i686 i386 gnulinux ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after- statement -I/usr/local/include -D_LARGEFILE_SOURCE - D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after- statement -I/usr/local/include' ccversion='', gccversion='3.4.5 20051201 (Red Hat 3.4.5-2)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.3.4.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.3.4' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO Built under linux Compiled at Jun 7 2006 07:50:37 @INC: /usr/local/lib/perl5/5.8.8/i686-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/i686-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl . bash-3.00#
Subject: Re: [rt.cpan.org #20787]
Date: Tue, 1 Aug 2006 08:24:25 -0500 (CDT)
To: lee via RT <bug-DateTime [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Tue, 1 Aug 2006, lee via RT wrote: Show quoted text
> DateTime objects seem to ignore my DST (GMT, 1 Auguest). Thus DateTime > gives the wrong time for about half the year.
This doesn't tell me anything. Can you provide a code sample to demonstrate the problem?
Subject: Re: [rt.cpan.org #20787]
Date: Tue, 01 Aug 2006 19:17:01 +0100
To: bug-DateTime [...] rt.cpan.org
From: Lee Goddard <lee [...] leegoddard.net>
Create a date for today: the time is off by an hour. autarch@urth.org via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=20787 > > > On Tue, 1 Aug 2006, lee via RT wrote: > >
>> DateTime objects seem to ignore my DST (GMT, 1 Auguest). Thus DateTime >> gives the wrong time for about half the year. >>
> > This doesn't tell me anything. Can you provide a code sample to > demonstrate the problem? > > >
-- Lee Goddard, BA (Hons), MSc www: LeeGoddard.net tel: 0208 369 6832 ltd: Server-side Systems ten: Ten years programming the net

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #20787]
Date: Tue, 01 Aug 2006 19:17:33 +0100
To: bug-DateTime [...] rt.cpan.org
From: Lee Goddard <lee [...] leegoddard.net>
Create a date for today: the time is off by an hour. Using the today method. Does that tell you anything? autarch@urth.org via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=20787 > > > On Tue, 1 Aug 2006, lee via RT wrote: > >
>> DateTime objects seem to ignore my DST (GMT, 1 Auguest). Thus DateTime >> gives the wrong time for about half the year. >>
> > This doesn't tell me anything. Can you provide a code sample to > demonstrate the problem? > > >
-- Lee Goddard, BA (Hons), MSc www: LeeGoddard.net tel: 0208 369 6832 ltd: Server-side Systems ten: Ten years programming the net

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #20787]
Date: Tue, 1 Aug 2006 18:13:02 -0500 (CDT)
To: "west.finchley [...] leegoddard.net via RT" <bug-DateTime [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Tue, 1 Aug 2006, west.finchley@leegoddard.net via RT wrote: Show quoted text
> Create a date for today: the time is off by an hour. Using the today > method. Does that tell you anything?
How is your local time zone set on your system, and what is is set to?
Subject: Re: [rt.cpan.org #20787]
Date: Wed, 2 Aug 2006 10:57:49 +0100 (BST)
To: bug-DateTime [...] rt.cpan.org
From: leeg1644 [...] leegoddard.net
Show quoted text
> How is your local time zone set on your system, and what is is set to?
I'm in London, and perl's localtime reports the time correctly, and ((localtime)[8]) is true. If you would like me to run a relevant command, please let me know, and I will report back. Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=linux, osvers=2.6.12.6-xen3_12.1_rhel4.1, archname=i686-linux uname='linux rnddev 2.6.12.6-xen3_12.1_rhel4.1 #1 smp tue jan 31 14:04:08 pst 2006 i686 i686 i386 gnulinux ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include' ccversion='', gccversion='3.4.5 20051201 (Red Hat 3.4.5-2)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.3.4.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.3.4' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO Built under linux Compiled at Jun 7 2006 07:50:37 @INC: /usr/local/lib/perl5/5.8.8/i686-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/i686-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl . b
Subject: Re: [rt.cpan.org #20787]
Date: Wed, 2 Aug 2006 05:17:28 -0500 (CDT)
To: "leeg1644 [...] leegoddard.net via RT" <bug-DateTime [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Wed, 2 Aug 2006, leeg1644@leegoddard.net via RT wrote: Show quoted text
> > Queue: DateTime > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=20787 > >
>> How is your local time zone set on your system, and what is is set to?
> > I'm in London, and perl's localtime reports the time correctly, and > ((localtime)[8]) is true. If you would like me to run a relevant command, > please let me know, and I will report back.
Well, what I really want to know is the name of your system's time zone. This can be in a number of different spots, depending on your OS (and distro). Also, I'd like to see the code you're running,. Bug reports should always include code!
Subject: Re: [rt.cpan.org #20787]
Date: Thu, 3 Aug 2006 13:03:44 +0100 (BST)
To: bug-DateTime [...] rt.cpan.org
From: leeg1644 [...] leegoddard.net
Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=20787 > > > On Tue, 1 Aug 2006, west.finchley@leegoddard.net via RT wrote: >
>> Create a date for today: the time is off by an hour. Using the today >> method. Does that tell you anything?
> > How is your local time zone set on your system, and what is is set to?
Well, this is Linux: CentOS to be precise, but it's still the same: lrwxrwxrwx 1 root root 33 Jun 16 16:03 /etc/localtime -> /usr/share/zoneinfo/Europe/London As before, this is correct: I am in London. When I run this perl: use DateTime; warn DateTime->now; # ->truncate( to => 'hour' ); warn scalar localtime; I get this output: 2006-08-03T12:04:03 at temp.pl line 3. Thu Aug 3 13:04:03 2006 at temp.pl line 4. Looks like you are not counting daylight-saving time.
Subject: Re: [rt.cpan.org #20787]
Date: Thu, 3 Aug 2006 08:30:22 -0500 (CDT)
To: "leeg1644 [...] leegoddard.net via RT" <bug-DateTime [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Thu, 3 Aug 2006, leeg1644@leegoddard.net via RT wrote: Show quoted text
> warn DateTime->now; # ->truncate( to => 'hour' );
now() returns a DateTeime object in the UTC time zone. If you want it to try to figure out your local time zone (really, whatever the system you're on thinks local is) then you need to do this: DateTime->now( time_zone => 'local' );
Subject: Re: [rt.cpan.org #20787]
Date: Thu, 03 Aug 2006 20:04:18 +0100
To: bug-DateTime [...] rt.cpan.org
From: Lee Goddard <lee [...] leegoddard.net>
AAHH! Thanks! What really confused me is that it differs from the perl default, which is a very natural real-world default.... Thanks for your time on this! lee autarch@urth.org via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=20787 > > > On Thu, 3 Aug 2006, leeg1644@leegoddard.net via RT wrote: > >
>> warn DateTime->now; # ->truncate( to => 'hour' ); >>
> > now() returns a DateTeime object in the UTC time zone. If you want it to > try to figure out your local time zone (really, whatever the system you're > on thinks local is) then you need to do this: > > DateTime->now( time_zone => 'local' ); > > >
-- Lee Goddard, BA (Hons), MSc www: LeeGoddard.net tel: 0208 369 6832 ltd: Server-side Systems ten: Ten years programming the net

Message body is not shown because sender requested not to inline it.