[issue7584] datetime.rfcformat() for Date and Time on the Internet

Daniel Urban report at bugs.python.org
Wed Apr 28 19:40:10 CEST 2010


Daniel Urban <urban.dani+py at gmail.com> added the comment:

> My Python code as well as your patch doesn't specify that "Z" must be
> present when time zone offset is unknown or absent,

Yes, that is because RFC 3339 explicitly says (in 4.3.) that -00:00 is "differs semantically from an offset of "Z" or "+00:00", which imply that UTC is the preferred reference point for the specified time". It also says that  if "the offset to local time is unknown, this can be represented with an offset of "-00:00"". So I don't think we can write "Z" or "+00:00" if we don't know the UTC offset.

> but Atom
> specification mentions that

It says "an uppercase "Z" character MUST be present in the absence of a numeric time zone offset". Correct me if I'm wrong, but "-00:00" *is* a numeric time zone offset. So it isn't absent.

> and I believe this is that most users
> expect to see.

I think the RFC is clear (but correct me if I'm mistaken): we cannot replace "-00:00" with it. We of course could replace "+00:00" with "Z".

> In fact I needed such function for implementing Atom
> feed for Trac, so in my opinion Z is more clear than -00:00 or +00:00

It may be better than "+00:00", but according to the RFC it simply doesn't mean the same thing as "-00:00".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7584>
_______________________________________


More information about the Python-bugs-list mailing list