Code

Convert time
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 Dec 2009 13:17:06 +0000 (13:17 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 Dec 2009 13:17:06 +0000 (13:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14984 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/rsyslog/addons/rsyslog/class_rsyslog.inc

index 564bb2afe81bd1cf5ddf86be8f1f7ef89acfd1c6..87e4df6cd6f826b8c651029d4e9d42c61b45c229 100644 (file)
@@ -226,6 +226,7 @@ class rsyslog extends plugin
         $res = mysql_query($query, $link);
         if($res){
           while($attrs = @mysql_fetch_assoc($res)){
+            $attrs['DeviceReportedTime']= $this->time2local($attrs['DeviceReportedTime']);
             $attrs['Facility']= $this->facility2string($attrs['Facility']);
             $attrs['Priority']= $this->severity2string($attrs['Priority']);
             $result['entries'][] = $attrs;
@@ -351,6 +352,12 @@ class rsyslog extends plugin
   }
 
 
+  function time2local($str)
+  {
+    list($date, $time)= split(" ", $str);
+    list($y, $m, $d)= split("-", $date);
+    return "$d.$m.$y $time";
+  }
 
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: