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

Method now

Lib/_pydatetime.py:1921–1924  ·  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

1919
1920 @classmethod
1921 def now(cls, tz=None):
1922 "Construct a datetime from time.time() and optional time zone info."
1923 t = _time.time()
1924 return cls.fromtimestamp(t, tz)
1925
1926 @classmethod
1927 def utcnow(cls):

Callers 15

constructorMethod · 0.80
_animateMethod · 0.80
package_versionFunction · 0.80
readWriteHelperFunction · 0.80
package_versionFunction · 0.80
_print_debugMethod · 0.80
localtimeFunction · 0.80
time2isozFunction · 0.80
time2netscapeFunction · 0.80
AiFunction · 0.80
CiFunction · 0.80
PiFunction · 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