Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class View_Helper_SecondConversion extends Zend_View_Helper_Abstract
- {
- public function SecondConversion($time)
- {
- if($time != -1)
- {
- if($time >= 60)
- {
- $seconds = $time % 60;
- $time = ($time - $seconds) / 60;
- if($time >= 60)
- {
- $minutes = $time % 60;
- $time = ($time - $minutes) / 60;
- if($time >= 60)
- {
- $hours = $time % 60;
- $time = ($time - $hours) / 24;
- return $time." d ".$hours." h ".$minutes." m ".$seconds." s";
- }
- else {
- return $time." h ".$minutes." m ".$seconds." s";
- }
- }
- else {
- return $time." m ".$seconds." s";
- }
- }
- else {
- return $time." s";
- }
- }
- else {
- return "-";
- }
- }
- }
Add Comment
Please, Sign In to add comment