I'm trying to convert tai64 timestamps (qmail) to human-readable form. I installed DateTime::Format::Epoch::TAI64 and dependancies, and below is the latest mutation of a test program. The output lists the tai64 timestamp correctly, and the source IP ($src), but the converted time ($dt->hms) is 00:00:00. What have I missed? Do I have to explicitly invoke a conversion of the data or something?
j #!/usr/bin/perl # # # [EMAIL PROTECTED] # use strict; use warnings; use DateTime; use DateTime::Format::Epoch::TAI64; my $formatter = DateTime::Format::Epoch::TAI64->new(); open QLOG1, "/home/qlog1/smtpd/current" or die $!; while (<QLOG1>) { if (/ ok /) { my ($time,undef,undef,undef,undef,$src) = split; # substr to eliminate the leading '@' $time = substr $time, 1; print "$time - "; my $dt = $formatter->parse_datetime( $time ); $time=$dt->hms; print "\"$src\" at $time\n"; } } -- "Not all those who wander are lost." - JRR Tolkien -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>