in reply to Re: split function
in thread split function

Thank you, is there a way of substracting 20 minutes from currentt time. I need to convert tht time format into like 01/26/2011 03:29:00 and pass to the database api but I need to substract 20 minutes from the current time and submit the date in that format.

Replies are listed 'Best First'.
Re^3: split function
by ikegami (Patriarch) on Jan 27, 2011 at 21:09 UTC
    use DateTime qw( ); my $dt = DateTime->now( time_zone => 'local' ); $dt->subtract( minutes => 20 ); print($dt->strftime("%d/%m/%Y %H:%M:%S"), "\n");

    DateTime

Re^3: split function
by Anonymous Monk on Jan 27, 2011 at 20:54 UTC
    Sure, visit the Time::Piece documentation, and read all about it