Help for this page

Select Code to Download


  1. or download this
    my @time = localtime;
    my $time = sprintf "%04d" . "%02d" x 5, 
    ...
                       $time[4] + 1,      # month
                       @time[3, 2, 1, 0]; # day, hour, minute, second
    print $time;
    
  2. or download this
    use Time::Format qw/%time/;
    
    my $time = $time{'yyyymmddhhmmss'};
    print $time;
    
  3. or download this
    use Date::Format;
    
    my $time = strftime "%Y%m%d%H%M%S", @{[localtime]};
    print $time;