diff options
author | Michael G Schwern <schwern@pobox.com> | 2008-09-13 19:40:58 -0700 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-01-03 18:37:02 +0100 |
commit | 9b3ca67b76fa79ecb7d074f90d239dfb4b1a916d (patch) | |
tree | 1d87c8986cfea2e81c40e435daa63d5c5ebdaa48 /lib/Time | |
parent | 769448c3cab313c28d3bb9ef48e54401476b9607 (diff) | |
download | perl-9b3ca67b76fa79ecb7d074f90d239dfb4b1a916d.tar.gz |
Write down the logic behind the localtime vs gmtime date ranges.
Diffstat (limited to 'lib/Time')
-rw-r--r-- | lib/Time/gmtime.t | 3 | ||||
-rw-r--r-- | lib/Time/localtime.t | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/Time/gmtime.t b/lib/Time/gmtime.t index 0e3855c8db..383eeda73a 100644 --- a/lib/Time/gmtime.t +++ b/lib/Time/gmtime.t @@ -11,7 +11,8 @@ BEGIN { plan tests => 37; } BEGIN { use_ok Time::gmtime; } -for my $time (0, 2**31-1, 2**33, time) { +# Perl has its own gmtime() so it's safe to do negative times. +for my $time (-2**33, -2**31-1, 0, 2**31-1, 2**33, time) { my $gmtime = gmtime $time; # This is the OO gmtime. my @gmtime = CORE::gmtime $time; # This is the gmtime function diff --git a/lib/Time/localtime.t b/lib/Time/localtime.t index 5d935e76b8..10df765fc3 100644 --- a/lib/Time/localtime.t +++ b/lib/Time/localtime.t @@ -25,6 +25,8 @@ BEGIN { plan tests => 37; } BEGIN { use_ok Time::localtime; } +# Since Perl's localtime() still uses the system localtime, don't try +# to do negative times. The system might not support it. for my $time (0, 2**31-1, 2**33, time) { my $localtime = localtime $time; # This is the OO localtime. my @localtime = CORE::localtime $time; # This is the localtime function |