[ create a new paste ] login | about

Link: http://codepad.org/IXHMDqNr    [ raw code | output | fork ]

PHP, pasted on Sep 8:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
function convertSecondsToMinutes($amountofseconds){
           $minutes =  $amountofseconds / 60 ;
           $minutes =  floor($minutes) ;

           $seconds = $minutes * 60 ;          
           $seconds = $amountofseconds - $seconds ;
           $return = "$minutes minutes and $seconds seconds." ;
           return $return ;
           

}

$second = 3760 ;
$time = convertSecondsToMinutes($second) ;
echo $time ;
?>


Output:
1
62 minutes and 40 seconds.


Create a new paste based on this one


Comments: