⭐ in reply to How do I incorporate a timestamp into a file name?
this returns something like "2001-07-02_15-07-32"use POSIX; use constant DATETIME => strftime("%Y-%m-%d_%H-%M-%S", localtime);
i use this to name temp directories, like
which gives me a uniquely named dir. then my named temp files are more human readable, because i don't need the date/time string in their names.my $tmpdir = $ENV{TMP} . '/' . basename $0 . '.' . DATETIME . '.' . $$
~Particle
|
|---|