On Thu, Aug 27, 2015 at 10:38 AM, Akira Li <[email protected]> wrote:

> An *observation*: the local timezone -- the only timezone with a variable
> utc offset in _stdlib -- behaves like pytz_:
>
>   # start with the same utc time
>   utc_time = datetime(2015, 10, 25, 1, tzinfo=timezone.utc)
>   stdlib_time = utc_time.astimezone() # stdlib local time
>   pytz_time = utc_time.astimezone(tzlocal.get_localzone())
>

I have no idea where you get tzlocal from, but I can assure you that there
is no such thing in the standard library.

What we do have is an option to call .astimezone() without a tzinfo
argument and get an aware datetime instance with tzinfo set to a fixed
offset timezone.  In this respect, .astimezone() is indeed similar to
pytz's localize()/normalize(), but it is much simpler.
_______________________________________________
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