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
Message body not shown because it is not plain text.