@@ 17-20 (lines=4) @@ | ||
14 | ||
15 | public function secondsInStringTime($seconds) |
|
16 | { |
|
17 | if ($days = intval((floor($seconds / 86400)))) { |
|
18 | $seconds = $seconds - $days*86400; |
|
19 | $return .= ($return ? ' ' : '') . str_pad($days, 2, 0,STR_PAD_LEFT).'d'; |
|
20 | } |
|
21 | if ($hours = intval((floor($seconds / 3600))) OR $return) { |
|
22 | $seconds = $seconds - $hours*3600; |
|
23 | $return .= ($return ? ' ' : '') . str_pad($hours, 2, 0,STR_PAD_LEFT).'h'; |
|
@@ 21-24 (lines=4) @@ | ||
18 | $seconds = $seconds - $days*86400; |
|
19 | $return .= ($return ? ' ' : '') . str_pad($days, 2, 0,STR_PAD_LEFT).'d'; |
|
20 | } |
|
21 | if ($hours = intval((floor($seconds / 3600))) OR $return) { |
|
22 | $seconds = $seconds - $hours*3600; |
|
23 | $return .= ($return ? ' ' : '') . str_pad($hours, 2, 0,STR_PAD_LEFT).'h'; |
|
24 | } |
|
25 | if ($minutes = intval((floor($seconds / 60))) OR $return) { |
|
26 | $seconds = $seconds - $minutes*60; |
|
27 | $return .= ($return ? ' ' : '') . str_pad($minutes, 2, 0, STR_PAD_LEFT).'m'; |
|
@@ 25-28 (lines=4) @@ | ||
22 | $seconds = $seconds - $hours*3600; |
|
23 | $return .= ($return ? ' ' : '') . str_pad($hours, 2, 0,STR_PAD_LEFT).'h'; |
|
24 | } |
|
25 | if ($minutes = intval((floor($seconds / 60))) OR $return) { |
|
26 | $seconds = $seconds - $minutes*60; |
|
27 | $return .= ($return ? ' ' : '') . str_pad($minutes, 2, 0, STR_PAD_LEFT).'m'; |
|
28 | } |
|
29 | ||
30 | $seconds = round($seconds, 2); |
|
31 | if ($seconds) { |
@@ 103-106 (lines=4) @@ | ||
100 | ||
101 | public function secondsInCronoTime($seconds) |
|
102 | { |
|
103 | if ($days = intval((floor($seconds / 86400)))) { |
|
104 | $seconds = $seconds - $days*86400; |
|
105 | $return .= ($return ? ':' : '') . str_pad($days, 2, 0,STR_PAD_LEFT); |
|
106 | } |
|
107 | if ($hours = intval((floor($seconds / 3600))) OR $return) { |
|
108 | $seconds = $seconds - $hours*3600; |
|
109 | $return .= ($return ? ':' : '') . str_pad($hours, 2, 0,STR_PAD_LEFT); |
|
@@ 107-110 (lines=4) @@ | ||
104 | $seconds = $seconds - $days*86400; |
|
105 | $return .= ($return ? ':' : '') . str_pad($days, 2, 0,STR_PAD_LEFT); |
|
106 | } |
|
107 | if ($hours = intval((floor($seconds / 3600))) OR $return) { |
|
108 | $seconds = $seconds - $hours*3600; |
|
109 | $return .= ($return ? ':' : '') . str_pad($hours, 2, 0,STR_PAD_LEFT); |
|
110 | } |
|
111 | if ($minutes = intval((floor($seconds / 60))) OR $return) { |
|
112 | $seconds = $seconds - $minutes*60; |
|
113 | $return .= ($return ? ':' : '') . str_pad($minutes, 2, 0, STR_PAD_LEFT); |
|
@@ 111-114 (lines=4) @@ | ||
108 | $seconds = $seconds - $hours*3600; |
|
109 | $return .= ($return ? ':' : '') . str_pad($hours, 2, 0,STR_PAD_LEFT); |
|
110 | } |
|
111 | if ($minutes = intval((floor($seconds / 60))) OR $return) { |
|
112 | $seconds = $seconds - $minutes*60; |
|
113 | $return .= ($return ? ':' : '') . str_pad($minutes, 2, 0, STR_PAD_LEFT); |
|
114 | } |
|
115 | $seconds = round($seconds, 2); |
|
116 | $return .= ($return ? ':' : '') . str_pad($seconds, 2, 0, STR_PAD_LEFT); |
|
117 |