Vema, Venkata wrote:
> HI
> The following pl pgm executes when the process "srvtst26.pl "is
> stopped. It gets started automatically started thru crontab by
> command "ahdxapi.init" what i want now is i want to write to a log
> file with time when it gets started "ahdxapi.init"
> can any one help me on this
Simple way to print a timestamp:
print "Timestamp: ", scalar(localtime), "\n";
outputs:
Timestamp: Tue Jun 3 08:25:16 2003
For flexible formatting, use the POSIX module's strftime() routine:
use POSIX 'strftime';
print "Timestamp: ", strftime('%m/%d/%Y %H:%M:%S', localtime), "\n";
outputs:
Timestamp: 06/03/2003 08:26:45
perldoc -f localtime
perldoc POSIX
HTH
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]