continued :)
[phpgitweb.git] / htdocs / lib / Tools.class.php
index 8ae07171cbdfaa089203f111a6c75dd3925dc0b5..d7f9075bff8522dabfc6525cdda50009cea3edae 100644 (file)
@@ -26,6 +26,7 @@ class Tools {
                if ($age > 60*60*24*365*2) {
                        $age_str = floor($age/60/60/24/365);
                        $age_str .= " years ago";
+                       $max_cache = (60*60*24*365) - ($age % (60*60*24*365));
                } else if ($age > 60*60*24*(365/12)*2) {
                        $age_str = floor($age/60/60/24/(365/12));
                        $age_str .= " months ago";
@@ -82,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