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

Method strftime

Lib/_pydatetime.py:1661–1673  ·  view source on GitHub ↗

Format using strftime(). The date part of the timestamp passed to underlying strftime should not be used. For a list of supported format codes, see the documentation: https://docs.python.org/3/library/datetime.html#format-codes

(self, format)

Source from the content-addressed store, hash-verified

1659 return cls(*time_components)
1660
1661 def strftime(self, format):
1662 """Format using strftime(). The date part of the timestamp passed
1663 to underlying strftime should not be used.
1664
1665 For a list of supported format codes, see the documentation:
1666 https://docs.python.org/3/library/datetime.html#format-codes
1667 """
1668 # The year must be >= 1000 else Python's strftime implementation
1669 # can raise a bogus exception.
1670 timetuple = (1900, 1, 1,
1671 self._hour, self._minute, self._second,
1672 0, 1, -1)
1673 return _wrap_strftime(self, format, timetuple)
1674
1675 def __format__(self, fmt):
1676 if not isinstance(fmt, str):

Callers 1

__format__Method · 0.95

Calls 1

_wrap_strftimeFunction · 0.85

Tested by

no test coverage detected