Help for this page

Select Code to Download


  1. or download this
       # get the seconds since epoch
       my $epoch = timelocal($seconds, $minutes, $hours, $mday, $mon, $yea
    +r);
    ...
    
       # get the date of X (requested) days ago
       my $past_date = localtime($past_epoch);
    
  2. or download this
       # get the seconds since epoch
       my $epoch = timegm(0,0,0, $mday, $mon, $year);
    ...
    
       # get the date of X (requested) days ago
       my $past_date = gmtime($past_epoch);