in reply to suggestions for log rotater...
One way to do it with localtime instead of the module, in the same number of lines, is:
One question is, does the Today() function return numbers, or strings with zero padding at the front? If they are numbers, you'll want to use a sprintf to zero pad it, or else use a glue character:my ($year, $month, $day) = (localtime)[5,4,3]; $timestamp = sprintf "%04i%02i%02i",$year+1900,$month,$day;
$timestamp = join('.',$year,$month,$day);
|
|---|