Help for this page

Select Code to Download


  1. or download this
    $ ./2.strftime.pl 
    It took me 10 seconds
    I was started on 2019-12-03 11:41:38 and ended on 2019-12-03 11:41:48
    $ cat 2.strftime.pl
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    use warnings;
    ...
    my $start_date = strftime "%Y-%m-%d %H:%M:%S",(localtime($start));
    my $end_date   = strftime "%Y-%m-%d %H:%M:%S",(localtime($end));
    print "I was started on $start_date and ended on $end_date\n";