This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Alexander.Belopolsky
Recipients Alexander.Belopolsky, belopolsky, docs@python, shaq, techtonik
Date 2011-09-15.20:26:48
SpamBayes Score 4.1345887e-05
Marked as misclassified No
Message-id <CAP7h-xY=q8x6+h-oULvRD7PC_a9AAcpgAepevLFC4kjwa+3bFw@mail.gmail.com>
In-reply-to <CAPkN8xLvbJJgP6kz0PUOnCYCyp7PZmwd7nHo2Erd8MVAbg233w@mail.gmail.com>
Content
On Thu, Sep 15, 2011 at 4:17 PM, anatoly techtonik
<report@bugs.python.org> wrote:
..
> Does that mean that if aware `datetime` is converted to `date` and
> then back, the tzinfo information is lost and object implicitly
> becomes naive?

Yes, but one cannot convert "back" from date to datetime.  To get a
datetime object, one needs to combine date and time and tzinfo is
attached to the time component.

> In this case it should mentioned IMO.

I agree.  The following is not really intuitive:

-> None

In order to preserve tzinfo, one has to preserve it when extracting
the time component:

-> datetime.timezone.utc
History
Date User Action Args
2011-09-15 20:26:48Alexander.Belopolskysetrecipients: + Alexander.Belopolsky, belopolsky, techtonik, docs@python, shaq
2011-09-15 20:26:48Alexander.Belopolskylinkissue8822 messages
2011-09-15 20:26:48Alexander.Belopolskycreate