MCPcopy Index your code
hub / github.com/RustPython/RustPython / utcnow

Method utcnow

Lib/_pydatetime.py:1892–1902  ·  view source on GitHub ↗

Construct a UTC datetime from time.time().

(cls)

Source from the content-addressed store, hash-verified

1890
1891 @classmethod
1892 def utcnow(cls):
1893 "Construct a UTC datetime from time.time()."
1894 import warnings
1895 warnings.warn("datetime.datetime.utcnow() is deprecated and scheduled for "
1896 "removal in a future version. Use timezone-aware "
1897 "objects to represent datetimes in UTC: "
1898 "datetime.datetime.now(datetime.UTC).",
1899 DeprecationWarning,
1900 stacklevel=2)
1901 t = _time.time()
1902 return cls._fromtimestamp(t, True, None)
1903
1904 @classmethod
1905 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