Message164614
| Author |
vinay.sajip |
| Recipients |
apalala, cblp, vinay.sajip |
| Date |
2012年07月03日.17:16:58 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1341335819.48.0.147807547947.issue14902@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Yes, thanks for doing the detailed analysis. I see that the original code was trying to adjust the timezone for a past time effectively using current timezone rules, which is why it doesn't work.
Your patch appears equivalent to the slightly simpler
dt = datetime.datetime(1993, 4, 21, 8, 3, 0, 0, utc)
r.created = time.mktime(dt.astimezone(None).timetuple())
which echoes the intent of the original code to adjust for the timezone. Can you see any reason why the above shouldn't work? On my test machine, it worked fine with the above code and locations of Moscow, London and Caracas (the original code failed with Caracas, though not with Moscow - but do I understand that the original is broken). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年07月03日 17:16:59 | vinay.sajip | set | recipients:
+ vinay.sajip, cblp, apalala |
| 2012年07月03日 17:16:59 | vinay.sajip | set | messageid: <1341335819.48.0.147807547947.issue14902@psf.upfronthosting.co.za> |
| 2012年07月03日 17:16:58 | vinay.sajip | link | issue14902 messages |
| 2012年07月03日 17:16:58 | vinay.sajip | create |
|