[3.11] gh-98378: Add small format string example to strftime comments (GH-98379) (#98395)

gh-98378: Add small format string example to strftime comments (GH-98379)

A small example of what a full date and time would look like would help a lot of developers who may not realize that they should investigate `time.h`'s `strftime`, run `man strftime`, or click through a series of docs on the python docs before they get to the actual [definition here](https://docs.python.org/3/library/datetime.htmlGH-strftime-and-strptime-format-codes) which still doesn't have an obvious copy-pastable example of "what the heck format does this thing actually expect?".

Automerge-Triggered-By: GH:rhettinger
(cherry picked from commit 6ccca69d0d)

Co-authored-by: Alex Zvorygin <grafetu@gmail.com>

Co-authored-by: Alex Zvorygin <grafetu@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-10-22 05:00:26 -07:00 committed by GitHub
parent 3cd39e9399
commit 9713cace26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1030,7 +1030,11 @@ class date:
self._day, self._year)
def strftime(self, fmt):
"Format using strftime()."
"""
Format using strftime().
Example: "%d/%m/%Y, %H:%M:%S"
"""
return _wrap_strftime(self, fmt, self.timetuple())
def __format__(self, fmt):