Skip to main content

float_as_datetime

No overview available.

def float_as_datetime(
timestamp: float
) - > datetime

Converts a floating-point timestamp into a timezone-aware datetime object. Use this to transform Unix epoch seconds into a standard Python datetime representation localized to UTC.

Parameters

NameTypeDescription
timestampfloatThe Unix epoch time in seconds to be converted into a datetime object.

Returns

TypeDescription
datetimeA UTC-localized datetime object corresponding to the provided timestamp.