Skip to content

Commit

Permalink
[DateTime.t] Golfed &us2007dst using hyperspaceships.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kodi Arfer authored and Kodi Arfer committed Oct 16, 2010
1 parent 866d5ab commit 592eef1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions S32-temporal/DateTime.t
Expand Up @@ -392,14 +392,9 @@ is dt(timezone => 3661).offset, 3661, 'DateTime.offset (1 hour, 1 minute, 1 seco
}

sub us2007dst($dt, $critical-hour) {
$dt.month > 3
|| $dt.month == 3
&& ($dt.day > 11
|| $dt.day == 11 && $dt.hour >= $critical-hour)
and $dt.month < 11
|| $dt.month == 11
&& ($dt.day < 4
|| $dt.day == 4 && $dt.hour < $critical-hour)
my $t = ($dt.month, $dt.day, $dt.hour);
([or] (3, 11, $critical-hour) »<=$t) == 0|-1
and ([or] $t »<=>« (11, 4, $critical-hour)) == -1
}

sub nyc-dt($year, $month, $day, $hour, $minute) {
Expand Down

0 comments on commit 592eef1

Please sign in to comment.