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

Method timestamp

Lib/_pydatetime.py:2053–2059  ·  view source on GitHub ↗

Return POSIX timestamp as float

(self)

Source from the content-addressed store, hash-verified

2051
2052
2053 def timestamp(self):
2054 "Return POSIX timestamp as float"
2055 if self._tzinfo is None:
2056 s = self._mktime()
2057 return s + self.microsecond / 1e6
2058 else:
2059 return (self - _EPOCH).total_seconds()
2060
2061 def utctimetuple(self):
2062 "Return UTC time tuple compatible with time.gmtime()."

Calls 2

_mktimeMethod · 0.95
total_secondsMethod · 0.80