$ ./1.strftime.pl Argument "Sun Dec 1 00:29:42 2019" isn't numeric in subtraction (-) at ./1.strftime.pl line 9. Argument "Sun Dec 1 00:29:52 2019" isn't numeric in subtraction (-) at ./1.strftime.pl line 9. It took me 0 seconds Usage: POSIX::strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1) at ./1.strftime.pl line 11. $ cat 1.strftime.pl #!/usr/bin/perl use strict; use warnings; use POSIX qw(strftime); my $start = gmtime(); sleep 10; my $end = gmtime(); my $duration = $end - $start; print "It took me $duration seconds\n"; my $start_date = strftime "%Y-%m-%d %H:%M:%S", $start; my $end_date = strftime "%Y-%m-%d %H:%M:%S", $end; print "I was started on $start_date and ended on $end_date\n"; $