-
-
Save andrewalker/a70fc5903f75c61a803d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings qw(all); | |
use DateTime; | |
my $year = $ARGV[0] || DateTime->now->year; | |
my $previous; | |
for ( | |
my ($here, $there) = map { | |
DateTime->new( | |
year => $year, | |
month => 1, | |
day => 1, | |
hour => 12, | |
time_zone => $_, | |
) | |
} qw(Europe/Amsterdam America/Sao_Paulo); | |
$here->year == $year; | |
$here->add(days => 1) && $there->add(days => 1) | |
) { | |
my $delta = $there - $here; | |
my $h = $delta->in_units("hours"); | |
if (! defined $previous || $previous != $h ) { | |
printf "%s\t%d\n", $here->dmy, $h; | |
$previous = $h; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment