This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: time format in logging is wrong
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.2
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: belopolsky, vinay.sajip,
Priority: normal Keywords:

Created on 2011-09-23 15:21 by, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg144447 - (view) Author: Yves Dorfsman ( Date: 2011-09-23 15:21
The basic time format in the logging module uses a comma instead of a dot to separate the seconds from the tenth of seconds:

    import logging
    logging.basicConfig(format='%(asctime)s %(message)s')

2011-09-23 09:08:53,739 hello

Using a dot seems to be more accepted, see:

ls -l --full-time

Java's default dates

python's datetime.datetime.isoformat( )
msg144448 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2011-09-23 16:00
Logging's date/time representation is supposed to conform to ISO 8601.

From ISO Standard 8601 (Third Edition, dated 2004-12-01): Representations with decimal fraction

If necessary for a particular application a decimal fraction of hour, minute or second may be included. If a decimal fraction is included, lower order time elements (if any) shall be omitted and the decimal fraction shall be divided from the integer part by the decimal sign specified in ISO 31-0, i.e. the comma [,] or full stop [.]. Of
these, the comma is the preferred sign.
Date User Action Args
2022-04-11 14:57:21adminsetgithub: 57245
2011-09-23 16:00:23vinay.sajipsetstatus: open -> closed
resolution: not a bug
messages: + msg144448
2011-09-23 15:33:42ezio.melottisetnosy: + vinay.sajip, belopolsky
2011-09-23 15:21:37yves@zioup.comcreate