timeuntil
Like timesince, but return a string measuring the time until the given time.
def timeuntil(
d: datetime,
now: datetime = null,
time_strings: dict = null,
depth: integer = 2
) - > string
Like timesince, but return a string measuring the time until the given time.
Parameters
| Name | Type | Description |
|---|---|---|
| d | datetime | The future date and time to measure the interval towards. |
| now | datetime = null | The reference datetime to measure from; defaults to the current time if not provided. |
| time_strings | dict = null | Optional dictionary containing custom translations for time units like 'year', 'month', etc. |
| depth | integer = 2 | The number of adjacent time units to include in the returned string for greater precision. |
Returns
| Type | Description |
|---|---|
string | A localized string representing the time interval remaining until the specified date, such as "2 days, 4 hours". |