Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Answer: How do I incorporate a timestamp into a file name?

( #93313=categorized answer: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use POSIX;
    use constant DATETIME => strftime("%Y-%m-%d_%H-%M-%S", localtime);
    
  2. or download this
    my $tmpdir = $ENV{TMP} . '/' . basename $0 . '.' . DATETIME . '.' . $$
    

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-11-29 00:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (200 votes), past polls