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.

classification
Title: datetime.isoformat() contaiins 'T0'
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: tim.peters Nosy List: anthonybaxter, dougfort, tim.peters
Priority: normal Keywords:

Created on 2004-06-02 13:50 by dougfort, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg21000 - (view) Author: Doug Fort (dougfort) Date: 2004-06-02 13:50
Python 2.3.4 (#1, May 27 2004, 13:38:36) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import datetime
>>> datetime.datetime.today().isoformat()
'2004-06-02T09:36:28.893992'

As of 2.3.4 the datetime.isoformat() includes  the characters 'T0' 
between the date and the time. I assume this is something  to do 
with the time zone.
msg21001 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2004-06-02 15:15
Logged In: YES 
user_id=29957

This isn't a bug. The 0 is the first digit of the hour, and
the T between the date and the hour is an optional part of
the standard (ISO 8601).

The ISO standard itself isn't freely available, but these
two links provide more information:

http://www.w3.org/TR/NOTE-datetime
http://www.cl.cam.ac.uk/~mgk25/iso-time.html
msg21002 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-06-02 15:17
Logged In: YES 
user_id=31435

No, nothing to do with time zones.  This is an ISO 8601 
date+time format.  ISO requires that a "T" separates the date 
portion from the time portion.  The "0" is from "09"; ISO 
requires exactly two digits for the hour portion of the time 
(and for minute, second, month, and day -- ISO 8601 is a 
fixed-width format).

There's no bug here, so closing.  Use Google to find the 8601 
standard (or one of the many summaries of it on the web).  
The method is called isoformat because of ISO <wink>.
History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40331
2004-06-02 13:50:24dougfortcreate