Last active
August 29, 2015 14:03
-
-
Save preaction/f482101582523105d949 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
use strict; | |
use feature qw( :5.16 ); | |
use DateTime; | |
my $now = DateTime->now( time_zone => 'America/Chicago' ); | |
my $lon = DateTime->today( time_zone => 'Europe/London' ); | |
$lon->set_hour( 6 ); | |
$lon->set_minute( 22 ); | |
while ( $lon < $now ) { | |
$lon->add( days => 1 ); | |
} | |
#say $now; | |
my $dur = $lon->delta_ms( $now ); | |
use Data::Dumper; | |
say Dumper $dur; | |
#say $dur; | |
say "Minutes: " . $dur->in_units('minutes'); | |
say "Minutes as seconds: " . $dur->in_units('minutes') * 60; | |
say "Seconds: " . ( ( $dur->in_units('minutes') * 60 ) + $dur->in_units('seconds')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment