Skip to main content

timeuntil_filter

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

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

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

Parameters

NameTypeDescription
valuedatetimeThe future date or datetime object to compare against the current time.
argdatetime = nullAn optional date or datetime object to use as the reference point instead of the current time.

Returns

TypeDescription
stringA human-readable string representing the time remaining until the given date, or an empty string if the input is invalid or missing.