diff options
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/lib/util.php b/lib/util.php index e3c20ddb858..0b8ea1ec907 100644 --- a/lib/util.php +++ b/lib/util.php @@ -129,23 +129,23 @@ class OC_Util { self::$headers[]=array('tag'=>$tag,'attributes'=>$attributes,'text'=>$text); } - /** - * formats a timestamp in the "right" way - * - * @param int timestamp $timestamp - * @param bool dateOnly option to ommit time from the result - */ - public static function formatDate( $timestamp,$dateOnly=false){ - if(isset($_SESSION['timezone'])){//adjust to clients timezone if we know it - $systemTimeZone = intval(date('O')); - $systemTimeZone=(round($systemTimeZone/100,0)*60)+($systemTimeZone%100); - $clientTimeZone=$_SESSION['timezone']*60; - $offset=$clientTimeZone-$systemTimeZone; - $timestamp=$timestamp+$offset*60; - } - $timeformat=$dateOnly?'F j, Y':'F j, Y, H:i'; - return date($timeformat,$timestamp); - } + /** + * formats a timestamp in the "right" way + * + * @param int timestamp $timestamp + * @param bool dateOnly option to ommit time from the result + */ + public static function formatDate( $timestamp,$dateOnly=false){ + if(isset($_SESSION['timezone'])){//adjust to clients timezone if we know it + $systemTimeZone = intval(date('O')); + $systemTimeZone=(round($systemTimeZone/100,0)*60)+($systemTimeZone%100); + $clientTimeZone=$_SESSION['timezone']*60; + $offset=$clientTimeZone-$systemTimeZone; + $timestamp=$timestamp+$offset*60; + } + $timeformat=$dateOnly?'F j, Y':'F j, Y, H:i'; + return date($timeformat,$timestamp); + } /** * Shows a pagenavi widget where you can jump to different pages. @@ -237,6 +237,12 @@ class OC_Util { if(!function_exists('ctype_digit')){ $errors[]=array('error'=>'PHP module ctype is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.'); } + if(!function_exists('json_encode')){ + $errors[]=array('error'=>'PHP module JSON is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.'); + } + if(!function_exists('imagepng')){ + $errors[]=array('error'=>'PHP module GD is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.'); + } return $errors; } |