Help for this page

Select Code to Download


  1. or download this
    use DateTime::Format::x509;
     
    my $f = DateTime::Format::x509->new();
    my $dt = $f->parse_datetime('Mar 11 03:05:34 2013 UTC');
    
  2. or download this
    my $dtparser = DateTime::Format::x509->new();
    
  3. or download this
    $line =~ /^\<\d+\>\w+\s+\d+:\d+:\d+\s+\w+:TIMESTAMP\=\w+\s+(\w+\s+\d+\
    +s+\d+:\d+:\d+\s+\d+).*MSGCLS.*$/m;
    $datestr = $1; # I use your regex but with day-name removed from brack
    +et, e.g. Oct  5 04:08:28 2018
    my $dtobj = $dtparser->parse_datetime($datestr);
    my $epoch = $dtobj->epoch();
    push @lines, [$line, $epoch]; # Line AND epoch saved into the array, m
    +aybe dtobj too for completeness
    
  4. or download this
    @sortedlines = sort { $a->[1] <=> $b->[1] } @lines;