get_datetime#

caf.toolkit.timing.get_datetime(time_format='%d-%m-%Y  %H:%M:%S.%f', precision='microsecond')[source]#

Get the current datetime at different precisions.

Parameters:
  • time_format (str) – What format to get the datetime at. Defaults to “%d-%m-%Y %H:%M:%S.%f”. See datetime.strftime() for acceptable formats

  • precision (Literal['millisecond', 'microsecond']) – What precision to get the datetime at. Currently, supports “microsecond” and “millisecond”.

Returns:

A string of the current datetime in time_format

Return type:

datetime_str