This method can be used in three different ways:
1. Using a timestamp that is relative to now.
2. Using a timestamp that is relative to the $referenceTime.
3. Using a DateInterval object.
public asRelativeTime ( integer | string | DateTim\DateTime | DateInterva\DateInterval $value, integer | string | DateTim\DateTime $referenceTime = null ) : string | ||
$value | integer | string | DateTim\DateTime | DateInterva\DateInterval | the value to be formatted. The following types of value are supported: - an integer representing a UNIX timestamp - a string that can be [parsed to create a DateTime object](http://php.net/manual/en/datetime.formats.php). The timestamp is assumed to be in [[defaultTimeZone]] unless a time zone is explicitly given. - a PHP [DateTime](http://php.net/manual/en/class.datetime.php) object - a PHP DateInterval object (a positive time interval will refer to the past, a negative one to the future) |
$referenceTime | integer | string | DateTim\DateTime | if specified the value is used as a reference time instead of `now` when `$value` is not a `DateInterval` object. |
return | string | the formatted result. |