Mercurial > ~mikael > mcabber > hg
comparison mcabber/contrib/cicq2mcabber.pl @ 242:cb2f18e20e6a
[/trunk] Changeset 255 by mikael
* cicq2mcabber.pl: convert date to iso8601 when importing centericq logfiles
author | mikael |
---|---|
date | Mon, 13 Jun 2005 19:58:58 +0000 |
parents | d416d5cb8ddb |
children |
comparison
equal
deleted
inserted
replaced
241:8584f919d9b9 | 242:cb2f18e20e6a |
---|---|
36 } | 36 } |
37 $date = $bdata{"timestamp"}; | 37 $date = $bdata{"timestamp"}; |
38 $len = $bdata{"nb"}; | 38 $len = $bdata{"nb"}; |
39 $data = $bdata{"msg"}; | 39 $data = $bdata{"msg"}; |
40 | 40 |
41 printf("%s%s %10u %03d %s", $type, $info, $date, $len, $data); | 41 # Date conversion to iso8601 |
42 my ($ss,$mm,$hh,$DD,$MM,$YYYY) = gmtime($date); | |
43 $date = sprintf "%04d%02d%02dT%02d:%02d:%02dZ", | |
44 $YYYY+1900, $MM+1,$DD,$hh,$mm,$ss; | |
45 | |
46 printf("%s%s %18.18s %03d %s", $type, $info, $date, $len, $data); | |
42 } | 47 } |
43 | 48 |
44 while ($line = <>) { | 49 while ($line = <>) { |
45 chomp $line; | 50 chomp $line; |
46 # The separator is ^L ; I use substr to exclude the EOL | 51 # The separator is ^L ; I use substr to exclude the EOL |