From 5e45bc877aa3e230f014a4a5e95b3911afdd86cd Mon Sep 17 00:00:00 2001 From: pzinovkin Date: Mon, 13 Apr 2009 08:19:51 +0000 Subject: [PATCH] int2time for more than 24hrs timestamps bugfix git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@71 4cb57b5f-5bbd-dd11-951b-001d605cbbc5 --- classes/Format.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/Format.class.php b/classes/Format.class.php index 92a11a7..842a008 100644 --- a/classes/Format.class.php +++ b/classes/Format.class.php @@ -67,8 +67,13 @@ class Format */ static public function int2time($timestamp = 0) { - $time = date(self::$time_format, $timestamp - self::$timezone_offset); - return $time; + $hours = floor($timestamp / 3600); + $minutes = floor(($timestamp / 60) - ($hours * 60)); + $seconds = $timestamp - ($hours * 3600) - ($minutes * 60); + + return ($hours < 10 ? ('0' . $hours) : $hours) + . ':' . ($minutes < 10 ? ('0' . $minutes) : $minutes) + . ':' . ($seconds < 10 ? ('0' . $seconds) : $seconds); } /**