src/Carbontwelve/Tools/Formatters/Time.php
public function toHuman()
	{
		$units = array(
            "week"   => 7*24*3600,
            "day"    =>   24*3600,
            "hour"   =>      3600,
            "minute" =>        60,
            "second" =>         1,
        );

        // specifically handle zero
        if ( $this->seconds == 0 ) return "0 seconds";

        $s = "";

        foreach ( $units as $name => $divisor ) {
            if ( $quot = intval($this->seconds / $divisor) ) {
                $s .= "$quot $name";
                $s .= (abs($quot) > 1 ? "s" : "") . ", ";
                $this->seconds -= $quot * $divisor;
            }
        }

        return substr($s, 0, -2);
	}
public function toHuman()
	{
		$units = array(
            "week"   => 7*24*3600,
            "day"    =>   24*3600,
            "hour"   =>      3600,
            "minute" =>        60,
            "second" =>         1,
        );

        // specifically handle zero
        if ( $this->seconds == 0 ) return "0 seconds";

        $s = "";

        foreach ( $units as $name => $divisor ) {
            if ( $quot = intval($this->seconds / $divisor) ) {
                $s .= "$quot $name";
                $s .= (abs($quot) > 1 ? "s" : "") . ", ";
                $this->seconds -= $quot * $divisor;
            }
        }

        return substr($s, 0, -2);
	}
public function toHuman ( ) { $ units = array ( "week" => 7 * 24 * 3600 , "day" => 24 * 3600 , "hour" => 3600 , "minute" => 60 , "second" => 1 , ) ; // specifically handle zero if ( $ this -> seconds == 0 ) return "0 seconds" ; $ s = "" ; foreach ( $ units as $ name => $ divisor ) { if ( $ quot = intval ( $ this -> seconds / $ divisor ) ) { $ s .= "$quot $name" ; $ s .= ( abs ( $ quot ) > 1 ? "s" : "" ) . ", " ; $ this -> seconds -= $ quot * $ divisor ; } } return substr ( $ s , 0 , - 2 ) ; }
Convert seconds to human readable text.

@source http://csl.name/php-secs-to-human-text/
@return string
Convert seconds to human readable text .