Previous topic

TxWeb

Next topic

Examples

This Page

Utilities

unuk.utils.timeutils.remaining(start, ends_in, relative=True, now=None)

Calculate the remaining time for a start date and a timedelta.

E.g. “how many seconds left for 30 seconds after start?”

Parameters:
  • start – Start datetime.datetime.
  • ends_in – The end delta as a datetime.timedelta.
  • relative – If set to False, the end time will be calculated using delta_resolution() (i.e. rounded to the resolution of ends_in).
  • now – The current time, defaults to datetime.now().