X-Git-Url: http://git.pk910.de/?p=phpgitweb.git;a=blobdiff_plain;f=htdocs%2Flib%2FTools.class.php;fp=htdocs%2Flib%2FTools.class.php;h=d7f9075bff8522dabfc6525cdda50009cea3edae;hp=d6f9b640acd129aee8c2e0ad6e79f6be1b9b77f9;hb=394a07ff3e283f94c7ead44e8bd02d44c223314b;hpb=ce9f1b8b05ff571f6922460cf91b45aa5a119d94 diff --git a/htdocs/lib/Tools.class.php b/htdocs/lib/Tools.class.php index d6f9b64..d7f9075 100644 --- a/htdocs/lib/Tools.class.php +++ b/htdocs/lib/Tools.class.php @@ -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