Skip Menu |

This queue is for tickets about the Class-Date CPAN distribution.

Report information
The Basics
Id: 23998
Status: resolved
Priority: 0/
Queue: Class-Date

People
Owner: dlux [...] dlux.hu
Requestors: tonnerre [...] thebsh.sygroup.ch
Cc:
AdminCc:

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



Subject: More time zone problems in strftime
Date: Tue, 19 Dec 2006 14:47:52 +0100
To: bug-Class-Date [...] rt.cpan.org
From: Tonnerre LOMBARD <tonnerre [...] thebsh.sygroup.ch>
Salut, I have a problem with strftime's %Z and %z parameters. Whenever I use them, they just return ÃGMT or +0000 respectively, regardless of the real time zone of the date. Test case: use Class::Date qw(date); my $dt = date("2006-06-24 05:23:42", "CET"); print($dt->to_tz("GMT")->strftime("%Y-%m-%d %H:%M:%S%z") . "\n" . $dt->strftime("%Y-%m-%d %H:%M:%S%z") . "\n"); This prints the following: 2006-06-24 03:23:42+0000 2006-06-24 05:23:42+0000 The first date is actually correct, as CET is GMT+2 during summer time. However, the second date isn't. (Well, it is correct in CET, but it shows GMT as time zone.) Tonnerre
Download (untitled)
application/pgp-signature 824b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #23998] AutoReply: More time zone problems in strftime
Date: Tue, 19 Dec 2006 15:04:22 +0100
To: Bugs in Class-Date via RT <bug-Class-Date [...] rt.cpan.org>
From: Tonnerre LOMBARD <tonnerre [...] thebsh.sygroup.ch>
Salut, As a side note, I also noticed that time zone specifications in the date strings don't get honored either: use Class::Date qw(date); my $dt = date("2006-06-24 05:23:42 +0400"); print($dt->to_tz("GMT")->strftime("%Y-%m-%d %H:%M:%S%z") . "\n"); This prints 2006-06-24 03:23:42+0000 whereas it ought to print 2006-06-24 01:23:42+0000. If, however, I specify my $dt = date("2006-06-24 05:23:42 +0400", "GMT-4");' it comes out correctly. (Please note as well that this works the wrong way around; it's actually GMT+4, not GMT-4.) Tonnerre
Hi, I've just picked up the RT bugs. Are you still having these problems? Do you maybe have more informations on them? Balázs On Tue Dec 19 09:04:42 2006, tonnerre@thebsh.sygroup.ch wrote: Show quoted text
> Salut, > > As a side note, I also noticed that time zone specifications in the date > strings don't get honored either: > > use Class::Date qw(date); > > my $dt = date("2006-06-24 05:23:42 +0400"); > print($dt->to_tz("GMT")->strftime("%Y-%m-%d %H:%M:%S%z") . "\n"); > > This prints 2006-06-24 03:23:42+0000 whereas it ought to print 2006-06-24 > 01:23:42+0000. If, however, I specify > > my $dt = date("2006-06-24 05:23:42 +0400", "GMT-4");' > > it comes out correctly. (Please note as well that this works the wrong way > around; it's actually GMT+4, not GMT-4.) > > Tonnerre