Help for this page

Select Code to Download


  1. or download this
      my $t = Time::Piece->strptime("Sunday 3rd Nov, 1943",
                                    "%A %drd %b, %Y");
     
      print $t->strftime("%a, %d %b %Y");
    
  2. or download this
      Wed, 03 Nov 1943
    
  3. or download this
    #!/usr/bin/perl
    # vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
    ...
    
    my $u = Time::Piece->strptime( $str, $pattern, );
    print "Time is:\n", $u->strftime( $pattern ), "\n";
    
  4. or download this
    $ perl ./tp_test.pl
    Time is:
    ...
              "Wed, 13 Jan 2021 22:21:49 CST", "%a, %d %b %Y %T %Z") 
              called at ./tp_test.pl line 23
    $
    
  5. or download this
    $ perl ./tp_test.pl
    Time is:
    ...
    Time is:
    Wed, 13 Jan 2021 22:21:49 CST
    $