◐ Shell
clean mode source ↗

Message 163135 - Python tracker

I have reviewed RFC 3339 and it looks like the following produces a fully compliant timestamp:
 
>>> print(datetime(2000,1,1, tzinfo=timezone.utc).isoformat('T'))
2000-01-01T00:00:00+00:00

I see the following remaining issues:

1. It is often desired to get RFC 3339 timestamp in local timezone instead of UTC.  This will be addressed in issue 9527.

2. If UTC timestamp is produced by a computer in non-UTC timezone, the offset should be specified as '-00:00'.  If this is important, an application can replace '+' with '-', but most likely specifying the correct local offset is a better option.

3. RFC 3339 requires support for leap seconds.  This limitation cannot be solved by adding a method to datetime.

Most importantly, given that there are several RFCs describing different  date formats, a datetime.rfcformat() method will be ambiguous.  (GNU date has --rfc-2822 and --rfc-3339 options and the later allows output of three different precisions.)

I am going to reject this RFE.  I don't think adding datetime.rfcformat() method will solve any real deficiency and whatever limitations datetime has with respect to producing RFC compliant timestamps should be addressed in future specific proposals.