I thought this was going to be very simple but I am really out of options now. I want to substract 15 minutes from a given time.
My time is 15:04 I want to substract 15 minutes to be 14:49. I have searched for solutions on the internet but there is no perl module that can help me out.
You can use
my $dt = DateTime->new( year => 1, month => 1, day => 1, hour => 15, minute => 4, ); $dt->subtract(minutes => 15); printf "%d:%d\n", $dt->hour, $dt->minute; # prints 14:49