⭐ in reply to How do I incorporate a timestamp into a file name?
Otherwise, you can put together the various numbers from localtime:my $filename = $directory . '/' . time() . '.ext';
my @lt = localtime(time); my $filename = sprintf "%s/%04d%02d%02d%02d%02d%02d", $directory, $lt[ +5]+1900, $lt[4]+1, @lt[3,2,1,0];
|
|---|