Message108462
| Author |
belopolsky |
| Recipients |
belopolsky, docs@python |
| Date |
2010年06月23日.17:14:44 |
| SpamBayes Score |
0.00011264311 |
| Marked as misclassified |
No |
| Message-id |
<1277313287.04.0.19115846548.issue9063@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
With python started at the root of the source tree and TZ=US/Eastern in the environment,
>>> exec(open('Doc/includes/tzinfo-examples.py').read())
>>> import os
>>> os.environ['TZ']
'US/Eastern'
>>> from datetime import *
>>> x = datetime(2010, 11, 7, 5, tzinfo=timezone.utc)
>>> print(x, x.astimezone(Local), x.astimezone(Eastern))
2010年11月07日 05:00:00+00:00 2010年11月07日 01:00:00-04:00 2010年11月07日 01:00:00-05:00
>>> x.astimezone(Local).dst() == x.astimezone(Eastern).dst()
False
Note that according to my understanding of the long comment at the end of datetimemodule.c, zone conversion from UTC is a well defined operation unless there is a bug in tzinfo subclass implementation. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年06月23日 17:14:47 | belopolsky | set | recipients:
+ belopolsky, docs@python |
| 2010年06月23日 17:14:47 | belopolsky | set | messageid: <1277313287.04.0.19115846548.issue9063@psf.upfronthosting.co.za> |
| 2010年06月23日 17:14:45 | belopolsky | link | issue9063 messages |
| 2010年06月23日 17:14:44 | belopolsky | create |
|