Help for this page

Select Code to Download


  1. or download this
    # no 29 feb 2001
    my $dt = Time::Piece->strptime("2001-02-29", "%F");
    # will return 2001-03-01 
    print $dt->strftime("%F");
    
  2. or download this
    my $dt = eval { 
              Time::Piece->strptime("2001-04-32", "%F")
             } or warn "This is not a valid date ($@).\n";