src/Date/DateUtils.php
public static function toRelativeTime($fromTime, $toTime = 'now', $format = 'days')
    {
        $startTime = new DateTime($fromTime);
        $endTime = new DateTime($toTime);

        return $startTime->diff($endTime)->$format;
    }
public static function toRelativeTime($fromTime, $toTime = 'now', $format = 'days')
    {
        $startTime = new DateTime($fromTime);
        $endTime = new DateTime($toTime);

        return $startTime->diff($endTime)->$format;
    }
public static function toRelativeTime ( $ fromTime , $ toTime = 'now' , $ format = 'days' ) { $ startTime = new DateTime ( $ fromTime ) ; $ endTime = new DateTime ( $ toTime ) ; return $ startTime -> diff ( $ endTime ) -> $ format ; }
Gets the difference between two date periods
@author Olawale Lawal <wale@cottacush.com>
@param $fromTime
@param string $toTime
@param string $format
@return string
Gets the difference between two date periods