Alexander Belopolsky <[email protected]> writes:
> On Tue, Aug 25, 2015 at 1:56 PM, Stuart Bishop <[email protected]>
> wrote:
>
>> What would be even nicer is if users didn't have to use localize at all:
>>
>> >> datetime.now(tz=pytz.timezone('US/Eastern'))
>>
>
> This is certainly one of the main goals of PEP 495. Note that
> datetime.now() will never produce an invalid datetime and will always set
> the fold attribute correctly in the (two-)fold case if
> pytz.timezone('US/Eastern') follows PEP guidelines. Therefore there is no
> need for the third fold value in this case.
datetime.now(pytz.timezone('US/Eastern')) already works [1]
It doesn't require the disambiguation flag for pytz timezones. Though the flag
might
be useful for dateutil timezones: datetime.now(dateutil.tz.tzlocal()) may
fail [2]
[1]
http://stackoverflow.com/questions/31886808/when-does-datetime-nowpytz-timezone-fail
[2] https://github.com/dateutil/dateutil/issues/57
_______________________________________________
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/