clp_ffi_py.utils module#

clp_ffi_py.utils.get_formatted_timestamp(timestamp, timezone)[source]#

Gets the formatted timestamp string from the provided timestamp with the provided timezone using isoformat.

Parameters:
  • timestamp (int) – Timestamp to format.

  • timezone (tzinfo | None) – Timezone of timestamp parameter. If None is given, UTC is used by default.

Returns:

String of formatted timestamp.

Return type:

str

clp_ffi_py.utils.get_timezone_from_timezone_id(timezone_id)[source]#

Gets the Python timezone object of the provided timezone id.

Parameters:

timezone_id (str) – Timezone Id.

Returns:

Timezone object.

Raises:

RuntimeError The given timestamp ID is invalid.

Return type:

tzinfo