Skip Montanaro
unread,May 17, 2018, 3:55:12 PM5/17/18You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
It seems that the logging.Formatter class uses two formats by default to
format a time, default_time_format (%Y-%m-%d %H:%M:%S) and
default_msec_format (%s,%03d). The former is a format string for
time.strftime (and thus can't represent fractions of a second). The latter
accomplishes that, but expanding %s with the output of (I believe)
time.strftime and %03d with the milliseconds in the current time. Users can
pass a datefmt arg to logging.basicConfig, or override the aforementioned
default_*_format attributes. Is there some way to format the timestamp with
both fractions of a second and timezone in a way similar to
datetime.strftime? In particular, I'd be happy with this format:
%Y-%m-%dT%H:%M:%S.%f%z. Maybe there is some magic flag to tell the system
I'm want to use datetime.strftime instead of time.strftime?
Thx,
Skip