Help for this page

Select Code to Download


  1. or download this
    use Time::Local;
    # get date and time
    ...
    
    # get epoch (use 0 for seconds)
    my $epoch = timelocal(0, $min, $hr, $d, $m, $y);
    
  2. or download this
    use POSIX 'strftime';
    my $fmt_date = strftime('%Y-%m-%d', localtime($epoch));