[issue9004] datetime.utctimetuple() should not set tm_isdst flag to 0

Alexander Belopolsky report at bugs.python.org
Mon Jun 21 17:35:17 CEST 2010


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

With timezone.utc available in datetime module, users should be encouraged to use dt.astimezone(timezone.utc).timetuple() instead of dt.utctimetuple().  Note that the later will set tm_isdst to -1.  This observation can be used to argue for either of two ways to resolve this issue:

1. Since utctimetuple() is no longer necessary, and the alternative works correctly, there is no need to fix it.  Just recommend the astimezone use in the docs and explain the subtle difference.

2. Having two ways to do the same thing which have a subtle difference is not a good idea.

I am leaning towards #1, but would like to hear from others.

----------

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


More information about the Python-bugs-list mailing list