Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Date and time for log files

by graff (Chancellor)
on Oct 04, 2007 at 22:56 UTC ( [id://642784]=note: print w/replies, xml ) Need Help??


in reply to Date and time for log files

use POSIX; my $filename = strftime( "%Y%m%d%H%M%S.log", localtime ); print "lets open a file called $filename ...\n";
Personally, I like to throw in a little punctuation, because it's easier to look at, and it can be easier to grep for a given day or a given hour:
strftime( "%Y%m%d_%H%M%S.log", localtime );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://642784]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-26 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found