changeset 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 8584f919d9b9
children c07fa9baca3f
files mcabber/contrib/cicq2mcabber.pl
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/contrib/cicq2mcabber.pl	Mon Jun 13 19:29:09 2005 +0000
+++ b/mcabber/contrib/cicq2mcabber.pl	Mon Jun 13 19:58:58 2005 +0000
@@ -38,7 +38,12 @@
   $len  = $bdata{"nb"};
   $data = $bdata{"msg"};
 
-  printf("%s%s %10u %03d %s", $type, $info, $date, $len, $data);
+  # Date conversion to iso8601
+  my ($ss,$mm,$hh,$DD,$MM,$YYYY) = gmtime($date);
+  $date = sprintf "%04d%02d%02dT%02d:%02d:%02dZ",
+                  $YYYY+1900, $MM+1,$DD,$hh,$mm,$ss;
+
+  printf("%s%s %18.18s %03d %s", $type, $info, $date, $len, $data);
 }
 
 while ($line = <>) {