ubelt.util_time module

This is util_time, it contains functions for handling time related code that I wish there was standard library support for. Currently there is only one function.

The timestamp() is less interesting than the previous two methods, but I have found it useful to have a function that quickly returns an iso8601 timestamp without much fuss.

Timerit is back! But it no longer lives in util_time. Instead it now lives in ubelt/timerit.py


Make an iso8601 timestamp suitable for use in filenames


method (str, default=’iso8601’) – type of timestamp


>>> import ubelt as ub
>>> stamp = ub.timestamp()
>>> print('stamp = {!r}'.format(stamp))
stamp = ...-...-...T...