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

Method now

Lib/_pydatetime.py:1886–1889  ·  view source on GitHub ↗

Construct a datetime from time.time() and optional time zone info.

(cls, tz=None)

Source from the content-addressed store, hash-verified

1884
1885 @classmethod
1886 def now(cls, tz=None):
1887 "Construct a datetime from time.time() and optional time zone info."
1888 t = _time.time()
1889 return cls.fromtimestamp(t, tz)
1890
1891 @classmethod
1892 def utcnow(cls):

Callers 15

_print_debugMethod · 0.80
localtimeFunction · 0.80
time2isozFunction · 0.80
time2netscapeFunction · 0.80
test_normalMethod · 0.80
test_roundtripMethod · 0.80
test_astimezoneMethod · 0.80
test_tzinfo_nowMethod · 0.80
test_more_astimezoneMethod · 0.80

Calls 2

timeMethod · 0.45
fromtimestampMethod · 0.45

Tested by 15

test_normalMethod · 0.64
test_roundtripMethod · 0.64
test_astimezoneMethod · 0.64
test_tzinfo_nowMethod · 0.64
test_more_astimezoneMethod · 0.64
test_bogus_dstMethod · 0.64
test_fromutcMethod · 0.64
test_comparisonMethod · 0.64