Code

Added DBsqlite to sed rewrite.
[gosa.git] / gosa-si / modules / GosaSupportDaemon.pm
index 8551a1782367677e8bfb506a16ed1757dca19dff..65bea486ad1499fab5cd1e2d101c9875cfef8028 100644 (file)
@@ -10,6 +10,7 @@ my @functions = (
     "create_xml_string",
     "transform_msg2hash",
     "get_time",
+    "get_utc_time",
     "build_msg",
     "db_res2xml",
     "db_res2si_msg",
@@ -180,10 +181,7 @@ sub add_content2xml_hash {
 
 
 sub get_time {
-       # Add an optional offset in seconds
-       #my $offset = $1 if shift =~ /^(\d+)$/ || 0;
        my ($seconds, $minutes, $hours, $monthday, $month,
-               #$year, $weekday, $yearday, $sommertime) = localtime(time+$offset);
                $year, $weekday, $yearday, $sommertime) = localtime;
        $hours = $hours < 10 ? $hours = "0".$hours : $hours;
        $minutes = $minutes < 10 ? $minutes = "0".$minutes : $minutes;
@@ -193,7 +191,13 @@ sub get_time {
        $monthday = $monthday < 10 ? $monthday = "0".$monthday : $monthday;
        $year+=1900;
        return "$year$month$monthday$hours$minutes$seconds";
+}
+
 
+sub get_utc_time {
+    my $utc_time = qx(date --utc +%Y%m%d%H%M%S);
+    $utc_time =~ s/\s$//;
+    return $utc_time;
 }