Skip Menu |
 

This queue is for tickets about the TimeDate CPAN distribution.

Report information
The Basics
Id: 52387
Status: open
Priority: 0/
Queue: TimeDate

People
Owner: Nobody in particular
Requestors: thomas.lehrner [...] culturall.com
Cc:
AdminCc:

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



Subject: seconds since the Epoch, UCT
Date: Thu, 03 Dec 2009 11:04:06 +0100
To: bug-TimeDate [...] rt.cpan.org
From: Thomas Lehrner <thomas.lehrner [...] culturall.com>
Download (untitled) / with headers
text/plain 887b
Hi, i think i found a bug in the calcultaion in the "seconds since the Epoch, UTC". Should not deliver "strftime("%s", @lt)" and "time2str("%s", time())" the same? perl -e 'use Date::Format; my @lt = localtime(time); print time()."\n"; print strftime("%s", @lt)."\n"; print time2str("%s", time())."\n"; print time2str("%s", time(), "CET");' example with my current time zone (CET): print $Date::Format::VERSION; => 2.23 perl -v => This is perl, v5.10.0 built for i86pc-solaris uname -a => SunOS 5.10 Generic_141415-05 i86pc i386 i86pc time() => 1259832417 strftime("%s", @lt) => 1259836017 correct time2str("%s", time()) => 1259832417 should be the same as strftime("%s", @lt)? time2str("%s", time(), "CET") => 1259832417 should be the same as strftime("%s", @lt)? Thanks in advance Thomas Lehrner
Fixed in TimeDate-1.20 just uploaded to CPAN. Allow a while for it to propagate to CPAN mirrors
From: thomas.lehrner [...] culturall.com
On Sat Dec 12 04:43:09 2009, GBARR wrote: Show quoted text
> Fixed in TimeDate-1.20 just uploaded to CPAN. Allow a while for it to > propagate to CPAN > mirrors
thanks for your quick response :-) but i have to annoy you again, sorry. :-P there are more errors now, or i missunderstand something. example: perl -e 'use Date::Format; my $time = time(); time for a wintertime #my $time = 1276883000; # this is a summertime my @lt = localtime($time); print "time = ".$time."\n"; print "strftime(default time zone) = ".strftime("%s", @lt)."\n"; print "strftime(CET time zone) = ".strftime("%s", @lt, "CET")."\n"; print "strftime(CEST time zone) = ".strftime("%s", @lt, "CEST")."\n"; print "strftime(AWST time zone) = ".strftime("%s", @lt, "AWST")."\n"; print "strftime(UTC time zone) = ".strftime("%s", @lt, "UTC")."\n"; print "strftime(GMT time zone) = ".strftime("%s", @lt, "GMT")."\n"; print "strftime(+0100 time zone) = ".strftime("%s", @lt, "+0100")."\n"; print "strftime(+0200 time zone) = ".strftime("%s", @lt, "+0200")."\n"; print "strftime(abcdef time zone) = ".strftime("%s", @lt, "abcdef")."\n"; print "time2str(default time zone) = ".time2str("%s", $time)."\n"; print "time2str(CET time zone) = ".time2str("%s", $time, "CET")."\n"; print "time2str(CEST time zone) = ".time2str("%s", $time, "CEST")."\n"; print "time2str(AWST time zone) = ".time2str("%s", $time, "AWST")."\n"; print "time2str(UTC time zone) = ".time2str("%s", $time, "UTC")."\n"; print "time2str(GMT time zone) = ".time2str("%s", $time, "GMT")."\n"; print "time2str(+0100 time zone) = ".time2str("%s", $time, "+0100")."\n"; print "time2str(+0200 time zone) = ".time2str("%s", $time, "+0200")."\n"; print "time2str(abcdef time zone) = ".time2str("%s", $time, "abcdef")."\n";' my current time zone is CET result: time = 1260789389 current utc strftime(default time zone) = 1260789389 should be +3600 strftime(CET time zone) = 1260792989 correct strftime(CEST time zone) = 1260792989 shouldn't be +3600 strftime(AWST time zone) = 1260792989 shouldn't be +3600 strftime(UTC time zone) = 1260792989 shouldn't be +3600 strftime(GMT time zone) = 1260792989 shouldn't be +3600 strftime(+0100 time zone) = 1260792989 correct strftime(+0200 time zone) = 1260792989 shouldn't be +3600 strftime(abcdef time zone) = 1260792989 maybe correct, if you use default time zone time2str(default time zone) = 1260789389 should be +3600 time2str(CET time zone) = 1260789389 should be +3600 time2str(CEST time zone) = 1260789389 shouldn't be utc time2str(AWST time zone) = 1260789389 shouldn't be utc time2str(UTC time zone) = 1260789389 correct time2str(GMT time zone) = 1260789389 correct time2str(+0100 time zone) = 1260789389 shouldn't be utc time2str(+0200 time zone) = 1260789389 shouldn't be utc time2str(abcdef time zone) = 1260789389 shouldn't be utc if you use "my $time = 1276883000; # this is a summertime" time = 1278783000 strftime(default time zone) = 1278783000 strftime(CET time zone) = 1278790200 strftime(CEST time zone) = 1278790200 strftime(AWST time zone) = 1278790200 strftime(UTC time zone) = 1278790200 strftime(GMT time zone) = 1278790200 strftime(+0100 time zone) = 1278790200 strftime(+0200 time zone) = 1278790200 strftime(abcdef time zone) = 1278790200 time2str(default time zone) = 1278783000 time2str(CET time zone) = 1278783000 time2str(CEST time zone) = 1278783000 time2str(AWST time zone) = 1278783000 time2str(UTC time zone) = 1278783000 time2str(GMT time zone) = 1278783000 time2str(+0100 time zone) = 1278783000 time2str(+0200 time zone) = 1278783000 time2str(abcdef time zone) = 1278783000 shouldn't be 'strftime("%s", @lt, "CET")', 'strftime("%s", @lt)', 'time2str("%s", $time, "CET")' and 'time2str("%s", $time)' the same if my system time is 'CET'? additionally, shouldn't the time value be +3600 in winter and time value+7200 in summer? shouldn't be the time zone overwritten, when you use other time zones? thanks in advance


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.