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 belopolsky
Recipients Daniel.O'Connor, belopolsky, bignose, r.david.murray
Date 2011-08-17.01:00:55
SpamBayes Score 3.58802e-11
Marked as misclassified No
Message-id <>
> i.e. it appears that replace() applies the TZ offset to a naive datetime
> object effectively assuming it is local time rather than un-timezoned
> (which is what the docs imply to me)

I don't understand your issue.  The replace method does not assume anything, it just replaces whatever fields you specify with new values.  You can replace tzinfo just like any other field, year, month, day, etc while preserving the other fields.  I think this is fairly well documented. I think what you are looking for is the astimezone() method which, however may not work well on naive datetime instances simply because a naive instance may be ambiguous in presence of DST.  However, if you start with an aware UTC datetime, you should be able to use astimezone() to convert to any local TZ.
Date User Action Args
2011-08-17 01:00:56belopolskysetrecipients: + belopolsky, r.david.murray, bignose, Daniel.O'Connor
2011-08-17 01:00:56belopolskysetmessageid: <>
2011-08-17 01:00:55belopolskylinkissue12750 messages
2011-08-17 01:00:55belopolskycreate