Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Date and time for log files

by nimdokk (Vicar)
on Oct 04, 2007 at 17:21 UTC ( #642711=note: print w/replies, xml ) Need Help??

in reply to Date and time for log files

Yet another way to do it might be as follows:
#!/usr/bin/perl use Time::localtime; $log_name=sprintf("my_log.%04d%02d%02d%02d%02d%02d.log", localtime->year()+1900, localtime->mon()+1,localtime->mday(), localtime->hour(), localtime->min(),localtime->sec()); print $log_name . "\n";
Would give you:

update: removed period between date and time to better reflect string from OP.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://642711]
[choroba]: You have to find out why it happened. Was there an OS update?
[vedagiri89]: that is what i can't getting solution
[vedagiri89]: recently purchased centos server and doing migration of app
[choroba]: did you copy any dependencies?
[choroba]: all XS code needs to be recompiled
[vedagiri89]: install perl5.16 in the new server and try to run appache
[hippo]: Which version of CentOS?
[vedagiri89]: how to fix: Attempt to reload aborted
[hippo]: Ah, presumably 7 then.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2018-06-19 11:27 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (113 votes). Check out past polls.