Help for this page

Select Code to Download


  1. or download this
    use POSIX 'strftime';
    
    ...
    my $date = strftime ('%Y%m%d', localtime $then);
    
    print $date; # prints 20020524
    
  2. or download this
    use Time::Piece;
    use Time::Seconds;
    ...
    my $then = $now - (14 * ONE_DAY);
    
    print $then->ymd; # or various other output functions