[ python-Bugs-965032 ] datetime.isoformat() contaiins 'T0'

SourceForge.net noreply at sourceforge.net
Wed Jun 2 11:17:37 EDT 2004


Bugs item #965032, was opened at 2004-06-02 09:50
Message generated for change (Comment added) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=965032&group_id=5470

Category: Python Library
>Group: Not a Bug
Status: Closed
Resolution: Invalid
Priority: 5
Submitted By: Doug Fort (dougfort)
>Assigned to: Tim Peters (tim_one)
Summary: datetime.isoformat() contaiins 'T0'

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2004-06-02 11:17

Message:
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>.

----------------------------------------------------------------------

Comment By: Anthony Baxter (anthonybaxter)
Date: 2004-06-02 11:15

Message:
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


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=965032&group_id=5470



More information about the Python-bugs-list mailing list