use DateTime qw( ); { my $now = DateTime->now( time_zone => 'local' ); ( my $dt = $now->clone ) ->add( seconds => $ARGV[0] ); print format_duration($dt - $now), "\n"; }