Skip to main content

timesince_filter

Format a date as the time since that date (i.e. "4 days, 6 hours").

def timesince_filter(
value: datetime,
arg: datetime = null
) - > string

Format a date as the time since that date (i.e. "4 days, 6 hours").

Parameters

NameTypeDescription
valuedatetimeThe initial datetime object from which the time difference is calculated.
argdatetime = nullAn optional datetime object to use as the comparison endpoint; if omitted, the current time is used.

Returns

TypeDescription
stringA human-readable string representing the elapsed time interval, or an empty string if the input is invalid or missing.