Swat/SwatString.php
public static function toHumanReadableTimePeriodWithWeeksAndDays($seconds)
    {
        $interval_parts =
            SwatDate::DI_YEARS |
            SwatDate::DI_WEEKS |
            SwatDate::DI_DAYS |
            SwatDate::DI_HOURS |
            SwatDate::DI_MINUTES |
            SwatDate::DI_SECONDS;

        $parts = self::getHumanReadableTimePeriodParts(
            $seconds,
            $interval_parts
        );

        if (isset($parts['weeks']) && isset($parts['days'])) {
            // reuse the weeks array key, to keep it in the correct position.
            $parts['weeks'] = self::toList(array(
                $parts['weeks'],
                $parts['days']
            ));

            unset($parts['days']);
        }

        return self::toHumanReadableTimePeriodString($parts, true);
    }
public static function toHumanReadableTimePeriodWithWeeksAndDays($seconds)
    {
        $interval_parts =
            SwatDate::DI_YEARS |
            SwatDate::DI_WEEKS |
            SwatDate::DI_DAYS |
            SwatDate::DI_HOURS |
            SwatDate::DI_MINUTES |
            SwatDate::DI_SECONDS;

        $parts = self::getHumanReadableTimePeriodParts(
            $seconds,
            $interval_parts
        );

        if (isset($parts['weeks']) && isset($parts['days'])) {
            // reuse the weeks array key, to keep it in the correct position.
            $parts['weeks'] = self::toList(array(
                $parts['weeks'],
                $parts['days']
            ));

            unset($parts['days']);
        }

        return self::toHumanReadableTimePeriodString($parts, true);
    }
public static function toHumanReadableTimePeriodWithWeeksAndDays ( $ seconds ) { $ interval_parts = SwatDate :: DI_YEARS | SwatDate :: DI_WEEKS | SwatDate :: DI_DAYS | SwatDate :: DI_HOURS | SwatDate :: DI_MINUTES | SwatDate :: DI_SECONDS ; $ parts = self :: getHumanReadableTimePeriodParts ( $ seconds , $ interval_parts ) ; if ( isset ( $ parts [ 'weeks' ] ) && isset ( $ parts [ 'days' ] ) ) { // reuse the weeks array key, to keep it in the correct position. $ parts [ 'weeks' ] = self :: toList ( array ( $ parts [ 'weeks' ] , $ parts [ 'days' ] ) ) ; unset ( $ parts [ 'days' ] ) ; } return self :: toHumanReadableTimePeriodString ( $ parts , true ) ; }
Gets a human-readable string representing a time period that includes
weeks and days as one time period part, and always returns the largest
part only.

This method formats seconds as a time period. Given an example value
of 7435400, the formatted value "12 weeks, 2 days" is returned.

As this method applies on seconds, no time zone considerations are
made. Years are assumed to be 365 days. Months are assumed to be 30 days.

@param integer $seconds seconds to format.

@return string A human-readable time period.
Gets a human - readable string representing a time period that includes weeks and days as one time period part and always returns the largest part only .