
On Thu, Jun 17, 2010 at 1:01 AM, Bruce Leban <bruce@leapyear.org> wrote: ..
When you say "And where in the docs would you explain the following: :-)" that sounds like you're saying "this is too confusing we shouldn't document it." To which I can only say :-(
I presented what I consider to be a bug. I opened an issue 9004, [1] "datetime.utctimetuple() should not set tm_isdst flag to 0" for that. There is no point in documenting the following as expected behavior:
time.strftime('%c %z %Z', datetime.utcnow().utctimetuple()) 'Wed Jun 16 03:26:26 2010 -0500 EST'
I believe it is better to fix it so that it produces
time.strftime('%c %z %Z', datetime.utcnow().utctimetuple()) 'Wed Jun 16 03:26:26 2010 '
instead. This, however shows limitation of datetime to timetuple conversion: there is currently no mechanism to store daylight saving time info in datetime object. See issue 9013. [2] Rather than fixing that, it would be much better to eliminate need for datetime to timetuple conversion in the first place. [1] http://bugs.python.org/issue9004 [2] http://bugs.python.org/issue9013