MCPcopy Index your code
hub / github.com/python/cpython / utcnow

Method utcnow

Lib/_pydatetime.py:1927–1937  ·  view source on GitHub ↗

Construct a UTC datetime from time.time().

(cls)

Source from the content-addressed store, hash-verified

1925
1926 @classmethod
1927 def utcnow(cls):
1928 "Construct a UTC datetime from time.time()."
1929 import warnings
1930 warnings.warn("datetime.datetime.utcnow() is deprecated and scheduled for "
1931 "removal in a future version. Use timezone-aware "
1932 "objects to represent datetimes in UTC: "
1933 "datetime.datetime.now(datetime.UTC).",
1934 DeprecationWarning,
1935 stacklevel=2)
1936 t = _time.time()
1937 return cls._fromtimestamp(t, True, None)
1938
1939 @classmethod
1940 def combine(cls, date, time, tzinfo=True):

Callers 3

test_utcnowMethod · 0.80
test_tzinfo_nowMethod · 0.80
test_extra_attributesMethod · 0.80

Calls 3

_fromtimestampMethod · 0.80
warnMethod · 0.45
timeMethod · 0.45

Tested by 3

test_utcnowMethod · 0.64
test_tzinfo_nowMethod · 0.64
test_extra_attributesMethod · 0.64