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

Method isoformat

Lib/_pydatetime.py:1614–1629  ·  view source on GitHub ↗

Return the time formatted according to ISO. The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional part is omitted if self.microsecond == 0. The optional argument timespec specifies the number of additional terms of the time to include. Valid options

(self, timespec='auto')

Source from the content-addressed store, hash-verified

1612 return s
1613
1614 def isoformat(self, timespec='auto'):
1615 """Return the time formatted according to ISO.
1616
1617 The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional
1618 part is omitted if self.microsecond == 0.
1619
1620 The optional argument timespec specifies the number of additional
1621 terms of the time to include. Valid options are 'auto', 'hours',
1622 'minutes', 'seconds', 'milliseconds' and 'microseconds'.
1623 """
1624 s = _format_time(self._hour, self._minute, self._second,
1625 self._microsecond, timespec)
1626 tz = self._tzstr()
1627 if tz:
1628 s += tz
1629 return s
1630
1631 __str__ = isoformat
1632

Callers

nothing calls this directly

Calls 2

_tzstrMethod · 0.95
_format_timeFunction · 0.85

Tested by

no test coverage detected