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