On Sat, Aug 22, 2015 at 2:53 PM, Alexander Belopolsky <
[email protected]> wrote:

> Some people on this list claimed that the following behavior is a bug:
>
> >>> (t + timedelta(100)).strftime('%F %T %Z%z')
> '2015-11-30 17:45:51 EDT-0400'
>
> because the correct result should be '2015-11-30 16:45:51 EST-0500'.
>
> My answer to that is that if you need that result, you can get it, but you
> have to ask for it explicitly:
>
> >>> (t + timedelta(100)).astimezone().strftime('%F %T %Z%z')
> '2015-11-30 16:45:51 EST-0500'
>
> I don't think we can do much here other than to educate Python users.
>

It is disappointing that you still believe this, because the intention of
introducing DST-aware tzinfo objects was to be able to get the latter
answer. The trick that pytz uses to obtain timeline arithmetic causes it to
use only fixed-offset tzinfo objects. It's true that some platforms may not
give enough information about the local timezone to do better -- but others
do. There is no requirement that tzname is unique to determine all the
properties of a timezone.

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Datetime-SIG mailing list
[email protected]
https://mail.python.org/mailman/listinfo/datetime-sig
The PSF Code of Conduct applies to this mailing list: 
https://www.python.org/psf/codeofconduct/

Reply via email to