Browse Source

int2time for more than 24hrs timestamps bugfix

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@71 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
master
pzinovkin 16 years ago
parent
commit
5e45bc877a
  1. 9
      classes/Format.class.php

9
classes/Format.class.php

@ -67,8 +67,13 @@ class Format
*/ */
static public function int2time($timestamp = 0) 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);
} }
/** /**

Loading…
Cancel
Save