Hi,

In Django's documentation, the 2 following points are mentionned [1]:

    - About date formating:

    "Uses the same format as PHP's date() function (http://php.net/date) with
some custom extensions."

    - About the specific "c" format:

    "ISO 8601 Format." e.g. : 2008-01-02T10:30:00.000123

As we can see in the example, the ouput of the "c" format does not provide
the time zone information (for example : +02:00).

Firstly, this is in contradiction with how PHP handles the "c" format : PHP
does provide the time zone information (their documentation uses
"2004-02-12T15:19:21+00:00" as the example for the "c" format [2]).
Therefore, at the very least Django's documentation is innacurate.

Secondly, even if the ISO 8601 standard allows many date formats, the
Internet usage is strongly oriented towards the use of the extended format
with time zone (for e.g. 2008-01-02T10:30:00.000123+02:00). In particular:

    - In current HTML5 editor's draft [3], the W3C makes the time-zone
offset mandatory for datetimes. A W3C note about the issue was also
published. [4]

    - In their Sitemap protocol documentation, Google asks for the time-zone
offset in datetimes, following the W3C Note. [5] [6]

    - The RFC 3339 says the following "the interoperability problems of
unqualified local time are deemed unacceptable for the Internet." [7]
Furthermore, it specifically mentions that date-time should be exprimed with
the timezone offset. [8]

I suggest that Django follows this usage and modifies its handling of this
format. However, since this clearly has backward compatibility issues, I'd
like to have a discussion about this before proposing a patch.

Thanks,

Yohan

[1] 
https://docs.djangoproject.com/en/1.3/ref/templates/builtins/<https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#date><http://piratepad.net/ep/search?query=date>
#date <https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#date>

[2] http://php.net/date <http://php.net/date)>

[3] 
http://dev.w3.org/html5/spec/common-microsyntaxes.html<http://dev.w3.org/html5/spec/common-microsyntaxes.html#valid-global-date-and-time-string><http://piratepad.net/ep/search?query=valid-global-date-and-time-string>
#valid-global-date-and-time-string<http://dev.w3.org/html5/spec/common-microsyntaxes.html#valid-global-date-and-time-string>

[4] http://www.w3.org/TR/NOTE-datetime

[5] 
http://www.sitemaps.org/protocol.php<http://www.sitemaps.org/protocol.php#lastmoddef><http://piratepad.net/ep/search?query=lastmoddef>
#lastmoddef <http://www.sitemaps.org/protocol.php#lastmoddef>

[6] 
http://www.google.com/support/webmasters/bin/answer.py?hl<http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=74288&from=42738&rd=1><http://piratepad.net/ep/search?query=en&answer>
=en&answer<http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=74288&from=42738&rd=1><http://piratepad.net/ep/search?query=74288&from>
=74288&from<http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=74288&from=42738&rd=1><http://piratepad.net/ep/search?query=42738&rd>
=42738&rd<http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=74288&from=42738&rd=1><http://piratepad.net/ep/search?query=1>
=1<http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=74288&from=42738&rd=1>

[7] 
http://www.apps.ietf.org/rfc/rfc3339.html<http://www.apps.ietf.org/rfc/rfc3339.html#sec-4.4><http://piratepad.net/ep/search?query=sec-4.4>
#sec-4.4 <http://www.apps.ietf.org/rfc/rfc3339.html#sec-4.4>

[8] 
http://www.apps.ietf.org/rfc/rfc3339.html<http://www.apps.ietf.org/rfc/rfc3339.html#sec-5.6><http://piratepad.net/ep/search?query=sec-5.6>
#sec-5.6 <http://www.apps.ietf.org/rfc/rfc3339.html#sec-5.6>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to