mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-33400: Clarified documentation to indicate no strict adherence to ISO 8601. (GH-6702)
This commit is contained in:
parent
9d3627e311
commit
c4994dc00d
4 changed files with 22 additions and 20 deletions
|
@ -466,7 +466,8 @@ class Formatter(object):
|
|||
|
||||
Initialize the formatter either with the specified format string, or a
|
||||
default as described above. Allow for specialized date formatting with
|
||||
the optional datefmt argument (if omitted, you get the ISO8601 format).
|
||||
the optional datefmt argument. If datefmt is omitted, you get an
|
||||
ISO8601-like (or RFC 3339-like) format.
|
||||
|
||||
Use a style parameter of '%', '{' or '$' to specify that you want to
|
||||
use one of %-formatting, :meth:`str.format` (``{}``) formatting or
|
||||
|
@ -494,13 +495,13 @@ class Formatter(object):
|
|||
in formatters to provide for any specific requirement, but the
|
||||
basic behaviour is as follows: if datefmt (a string) is specified,
|
||||
it is used with time.strftime() to format the creation time of the
|
||||
record. Otherwise, the ISO8601 format is used. The resulting
|
||||
string is returned. This function uses a user-configurable function
|
||||
to convert the creation time to a tuple. By default, time.localtime()
|
||||
is used; to change this for a particular formatter instance, set the
|
||||
'converter' attribute to a function with the same signature as
|
||||
time.localtime() or time.gmtime(). To change it for all formatters,
|
||||
for example if you want all logging times to be shown in GMT,
|
||||
record. Otherwise, an ISO8601-like (or RFC 3339-like) format is used.
|
||||
The resulting string is returned. This function uses a user-configurable
|
||||
function to convert the creation time to a tuple. By default,
|
||||
time.localtime() is used; to change this for a particular formatter
|
||||
instance, set the 'converter' attribute to a function with the same
|
||||
signature as time.localtime() or time.gmtime(). To change it for all
|
||||
formatters, for example if you want all logging times to be shown in GMT,
|
||||
set the 'converter' attribute in the Formatter class.
|
||||
"""
|
||||
ct = self.converter(record.created)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue