in reply to Reformatting Time in NT logs

See this perl.com article on date modules. What dragonchild said -- Date::Calc's your friend.
use Date::Calc qw(:all); ($year,$month,$day) = ($transfer_start_date =~ /(\d{4})(\d\d)(\d\d)/); ($hour, $min, $sec) = ($transfer_start_time =~ /(\d{4})(\d\d)(\d\d)/); print sprintf "%.3s %.3s %d %02d:%02d:%02d %4d", Day_of_Week_to_Text(D +ay_of_Week($year, $month, $day)), Month_to_Text($month), $day, $hour, + $min, $sec, $year; # or, simpler and pretty close print join ' ', Date_to_Text($year, $month, $day), sprintf "%02d%02d%0 +2d", $hour, $min, $sec;
(code untested)

Replies are listed 'Best First'.
Re: Re: Advice
by Nkuvu (Priest) on Oct 09, 2003 at 19:59 UTC

    The only thing I noticed in your untested code was that the regex for $transfer_start_time should probably be /(\d\d)(\d\d)(\d\d)/ (given the HHMMSS format as per the OP).