lib/private/legacy/template/functions.php
/**
 * Formats timestamp relatively to the current time using
 * a human-friendly format like "x minutes ago" or "yesterday"
 * @param int $timestamp timestamp to format
 * @param int $fromTime timestamp to compare from, defaults to current time
 * @param bool $dateOnly whether to strip time information
 * @return string timestamp
 */
Formats timestamp relatively to the current time using
a human-friendly format like "x minutes ago" or "yesterday"
@param int $timestamp timestamp to format
@param int $fromTime timestamp to compare from, defaults to current time
@param bool $dateOnly whether to strip time information
@return string timestamp
Formats timestamp relatively to the current time using a human - friendly format like " x minutes ago " or " yesterday " @param int $timestamp timestamp to format @param int $fromTime timestamp to compare from defaults to current time @param bool $dateOnly whether to strip time information @return string timestamp
function relative_modified_date($timestamp, $fromTime = null, $dateOnly = false) {
	$formatter = \OC::$server->query('DateTimeFormatter');
	if ($dateOnly){
		return $formatter->formatDateSpan($timestamp, $fromTime);
	}
	return $formatter->formatTimeSpan($timestamp, $fromTime);
}
function relative_modified_date ( $ timestamp , $ fromTime = null , $ dateOnly = false ) { $ formatter = \ OC :: $ server -> query ( 'DateTimeFormatter' ) ; if ( $ dateOnly ) { return $ formatter -> formatDateSpan ( $ timestamp , $ fromTime ) ; } return $ formatter -> formatTimeSpan ( $ timestamp , $ fromTime ) ; }
Formats timestamp relatively to the current time using
 a human-friendly format like "x minutes ago" or "yesterday"
 @param int $timestamp timestamp to format
 @param int $fromTime timestamp to compare from, defaults to current time
 @param bool $dateOnly whether to strip time information
 @return string timestamp
Formats timestamp relatively to the current time using a human - friendly format like " x minutes ago " or " yesterday " @param int $timestamp timestamp to format @param int $fromTime timestamp to compare from defaults to current time @param bool $dateOnly whether to strip time information @return string timestamp
/** @var \OC\DateTimeFormatter $formatter */