#!/usr/bin/perl -Twl use strict; use DateTime; use DateTime::TimeZone; print join $/, where_is_new_year(@ARGV); sub where_is_new_year { my $year = shift || (localtime())[5]+1901; my $hour = shift || 0; my $time = shift || time; grep { my $dt = DateTime->from_epoch( epoch => $time, time_zone => $_ ); $dt->year == $year && $dt->hour <= $hour; } DateTime::TimeZone::all_names; }
|
|---|