ID EN
Datetime

utcfromtimestamp

Python 3.11

Return the UTC datetime corresponding to the POSIX timestamp, with tzinfo None. (The resulting object is naive.)

Syntax

PYTHON
classmethod datetime.utcfromtimestamp(timestamp)

Examples

Example 1
PYTHON
datetime.fromtimestamp(timestamp, timezone.utc)
Example 2
PYTHON
datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)

See Also

datetime tzinfo OverflowError OSError datetime fromtimestamp() MINYEAR MAXYEAR