Skip to content

Instantly share code, notes, and snippets.

@creaktive
Created October 2, 2015 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save creaktive/89088e1fbede425f8470 to your computer and use it in GitHub Desktop.
Save creaktive/89088e1fbede425f8470 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings qw(all);
use DateTime;
my $year = $ARGV[0] || DateTime->now->year;
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;
printf "%s\t%d\n",
$here->dmy,
$delta->in_units("hours");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment