datetime - Substract 15 Minutes from time using Perl -
datetime - Substract 15 Minutes from time using Perl -
i thought going simple out of options now. want substract 15 minutes given time.
example time 15:04 want substract 15 minutes 14:49. have searched solutions on net there no perl module can help me out.
you can utilize datetime:
my $dt = datetime->new( year => 1, month => 1, day => 1, hr => 15, min => 4, ); $dt->subtract(minutes => 15); printf "%d:%d\n", $dt->hour, $dt->minute; # prints 14:49 perl datetime
Comments
Post a Comment