Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

2007 is when the American DST rules changed and some machines haven't…

… figured that out.
  • Loading branch information...
commit cbdd63ea3a1349c963df36ce9329823c40ddec1c 1 parent 364f863
@schwern authored
Showing with 22 additions and 16 deletions.
  1. +6 −0 perl/Time-y2038/Changes
  2. +16 −16 perl/Time-y2038/t/timegm.t
View
6 perl/Time-y2038/Changes
@@ -1,3 +1,9 @@
+Next
+ Tests
+ * Test against 2006, before the American DST rules changed, so
+ as not to break on old machines.
+
+
20100223 Tue Feb 23 11:57:23 PST 2010
Build
* Fix for JSON.pm not being available for Build.PL
View
32 perl/Time-y2038/t/timegm.t
@@ -25,43 +25,43 @@ for my $time (-2**52, -1, 0, 1, 2**52) {
SKIP: {
skip "Tests specific to US/Pacific time zone", 4 unless $Test_Localtime;
- # 1 second before new American DST spring ahead
- my $time = 1173607199;
- cmp_ok timelocal(59, 59, 1, 11, 2, 107), '==', $time,
+ # 1 second before old American DST spring ahead
+ my $time = 1143971999;
+ cmp_ok timelocal(59, 59, 1, 2, 3, 106), '==', $time,
'DST just before spring ahead';
- is localtime($time), 'Sun Mar 11 01:59:59 2007';
+ is localtime($time), 'Sun Apr 2 01:59:59 2006';
$time++;
- cmp_ok timelocal(0, 0, 3, 11, 2, 107), '==', $time,
+ cmp_ok timelocal(0, 0, 3, 2, 3, 106), '==', $time,
'DST just after spring ahead';
- is localtime($time), 'Sun Mar 11 03:00:00 2007';
+ is localtime($time), 'Sun Apr 2 03:00:00 2006';
# 1 second before fall back.
- $time = 1194163199;
- cmp_ok timelocal(59, 59, 0, 4, 10, 107), '==', $time,
+ $time = 1162108799;
+ cmp_ok timelocal(59, 59, 0, 29, 9, 106), '==', $time,
'DST just before fall back';
- is localtime($time), 'Sun Nov 4 00:59:59 2007';
+ is localtime($time), 'Sun Oct 29 00:59:59 2006';
- # Sun Nov 4 01:00:00 2007 DST, one second later
+ # Sun Oct 29 01:00:00 2006 DST, one second later
$time++;
- cmp_ok timelocal(0, 0, 1, 4, 10, 107, undef, undef, 1), '==', $time,
+ cmp_ok timelocal(0, 0, 1, 29, 9, 106, undef, undef, 1), '==', $time,
'DST at 1am';
- is localtime($time), 'Sun Nov 4 01:00:00 2007';
+ is localtime($time), 'Sun Oct 29 01:00:00 2006';
# After one hour, it's still 1am but no longer DST
$time += 3600;
- cmp_ok timelocal(0, 0, 1, 4, 10, 107, undef, undef, 0), '==', $time,
+ cmp_ok timelocal(0, 0, 1, 29, 9, 106, undef, undef, 0), '==', $time,
'not DST at 1am';
- is localtime($time), 'Sun Nov 4 01:00:00 2007';
+ is localtime($time), 'Sun Oct 29 01:00:00 2006';
# An hour later it's 2am.
$time += 3600;
- cmp_ok timelocal(0, 0, 2, 4, 10, 107), '==', $time,
+ cmp_ok timelocal(0, 0, 2, 29, 9, 106), '==', $time,
'3am after DST fall back is 2 hours after 2am';
- is localtime($time), 'Sun Nov 4 02:00:00 2007';
+ is localtime($time), 'Sun Oct 29 02:00:00 2006';
}
Please sign in to comment.
Something went wrong with that request. Please try again.