continued :)
[phpgitweb.git] / htdocs / lib / Tools.class.php
index d6f9b640acd129aee8c2e0ad6e79f6be1b9b77f9..d7f9075bff8522dabfc6525cdda50009cea3edae 100644 (file)
@@ -83,6 +83,13 @@ class Tools {
                return $ctext;
        }
        
+       public static function parseTimeZone($timezone) {
+               if(!preg_match("/^([+-])([0-9]{2})([0-9]{2})$/i", $timezone, $treffer))
+                       return 0;
+               $offset = ($treffer[1] == '-' ? -1 : 1) * (($treffer[2] * 3600) + ($treffer[3] * 60));
+               return $offset;
+       }
+       
 }
 
 ?>
\ No newline at end of file