早教吧作业答案频道 -->英语-->
PST8PDT,M3.2.0,M11.1.0
题目详情
PST8PDT,M3.2.0,M11.1.0
▼优质解答
答案和解析
On Windows, the calculation of when DST starts is incorrect. Windows OS
seems to be fully patched, and correctly changed to DST on 3-8-2009.
However, datetime.now() is 1 hour less then Windows displayed time.
I even tried setting the TZ environment variable to
PST8PDT,M3.2.0,M11.1.0 to fully specify the date change.
Below you can see that today (3-27-08) is marked as standard time, while
July 1st is DST and Jan 1st is Standard, if I understand the meaning of
the 9th element of the timetuple:
ON WINDOWS, with windows reporting the time as 3:59pm:
>>> july1 = datetime(2009, 7, 1)
>>> jan1 = datetime(2009, 1, 1)
>>> time.localtime(time.mktime(july1.timetuple()))
(2009, 7, 1, 0, 0, 0, 2, 182, 1)
>>> time.localtime(time.mktime(jan1.timetuple()))
(2009, 1, 1, 0, 0, 0, 3, 1, 0)
>>> time.localtime(time.mktime(datetime.now().timetuple()))
(2009, 3, 27, 14, 59, 46, 4, 86, 0)
It worked correctly on Linux, though:
>>> july1 = datetime(2009,7,1)
>>> jan1 = datetime(2009,1,1)
>>> time.localtime(time.mktime(july1.timetuple()))
(2009, 7, 1, 0, 0, 0, 2, 182, 1)
>>> time.localtime(time.mktime(jan1.timetuple()))
(2009, 1, 1, 0, 0, 0, 3, 1, 0)
>>> time.localtime(time.mktime(datetime.now().timetuple()))
(2009, 3, 27, 15, 57, 2, 4, 86, 1)
msg94678 - (view) Author: (acummings) Date: 2009-10-29 17:07
The same thing happens with the autumn transition. Windows knows the
transition has changed, but python does not seem to know that:
The following interactive session was run on Oct 29th, at 10:02 (Windows
clock reported 10:02):
>>> july1 = datetime(2009, 7, 1)
>>> jan1 = datetime(2009, 1,1)
>>> oct30 = datetime(2009, 10, 30)
>>> time.localtime(time.mktime(july1.timetuple()))
(2009, 7, 1, 0, 0, 0, 2, 182, 1)
>>> time.localtime(time.mktime(jan1.timetuple()))
(2009, 1, 1, 0, 0, 0, 3, 1, 0)
>>> time.localtime(time.mktime(oct30.timetuple()))
(2009, 10, 30, 0, 0, 0, 4, 303, 0)
>>> time.localtime(time.mktime(datetime.now().timetuple()))
(2009, 10, 29, 9, 2, 38, 3, 302, 0)
Again, the 9th element of the timetuple is 1 for July 1st, 0 for Jan
1st, and **0** for Oct 30th and Oct 29th. Also, the time reported by
datetime.now() was 9:02, one hour behind
所以说呢,它只不过是一个标签
seems to be fully patched, and correctly changed to DST on 3-8-2009.
However, datetime.now() is 1 hour less then Windows displayed time.
I even tried setting the TZ environment variable to
PST8PDT,M3.2.0,M11.1.0 to fully specify the date change.
Below you can see that today (3-27-08) is marked as standard time, while
July 1st is DST and Jan 1st is Standard, if I understand the meaning of
the 9th element of the timetuple:
ON WINDOWS, with windows reporting the time as 3:59pm:
>>> july1 = datetime(2009, 7, 1)
>>> jan1 = datetime(2009, 1, 1)
>>> time.localtime(time.mktime(july1.timetuple()))
(2009, 7, 1, 0, 0, 0, 2, 182, 1)
>>> time.localtime(time.mktime(jan1.timetuple()))
(2009, 1, 1, 0, 0, 0, 3, 1, 0)
>>> time.localtime(time.mktime(datetime.now().timetuple()))
(2009, 3, 27, 14, 59, 46, 4, 86, 0)
It worked correctly on Linux, though:
>>> july1 = datetime(2009,7,1)
>>> jan1 = datetime(2009,1,1)
>>> time.localtime(time.mktime(july1.timetuple()))
(2009, 7, 1, 0, 0, 0, 2, 182, 1)
>>> time.localtime(time.mktime(jan1.timetuple()))
(2009, 1, 1, 0, 0, 0, 3, 1, 0)
>>> time.localtime(time.mktime(datetime.now().timetuple()))
(2009, 3, 27, 15, 57, 2, 4, 86, 1)
msg94678 - (view) Author: (acummings) Date: 2009-10-29 17:07
The same thing happens with the autumn transition. Windows knows the
transition has changed, but python does not seem to know that:
The following interactive session was run on Oct 29th, at 10:02 (Windows
clock reported 10:02):
>>> july1 = datetime(2009, 7, 1)
>>> jan1 = datetime(2009, 1,1)
>>> oct30 = datetime(2009, 10, 30)
>>> time.localtime(time.mktime(july1.timetuple()))
(2009, 7, 1, 0, 0, 0, 2, 182, 1)
>>> time.localtime(time.mktime(jan1.timetuple()))
(2009, 1, 1, 0, 0, 0, 3, 1, 0)
>>> time.localtime(time.mktime(oct30.timetuple()))
(2009, 10, 30, 0, 0, 0, 4, 303, 0)
>>> time.localtime(time.mktime(datetime.now().timetuple()))
(2009, 10, 29, 9, 2, 38, 3, 302, 0)
Again, the 9th element of the timetuple is 1 for July 1st, 0 for Jan
1st, and **0** for Oct 30th and Oct 29th. Also, the time reported by
datetime.now() was 9:02, one hour behind
所以说呢,它只不过是一个标签
看了 PST8PDT,M3.2.0...的网友还看了以下:
6.3÷0.021=1.5÷0.03=0.43×5=0.7×8-0.6=72÷24=5×0.7=6 2020-04-07 …
5×0.7=0.43×5=3.6÷0.9-4=240÷37≈3.6-0.36=8.1-2.2=0. 2020-04-07 …
BP神经网络高手来5.1,3.5,1.4,0.2,Iris-setosa4.9,3.0,1.4,0 2020-05-17 …
有理数的加减法..(1)(-8)+10+2+(-1)(2)5+(-6)+3+9+(-4)+(-7) 2020-05-23 …
简算下列题目999.3-998.2+997.3-996.2+···+3.3-2.2+1.3-0.2 2020-06-05 …
如果有理数a,b满足|ab-2|+|1-b|=0.试求1/ab+1/(a+1)(b+1)+1(a+ 2020-07-09 …
67.28+0.75*12.5/0.625-81.75+0.472.25*2.4+77.5*0.2 2020-07-17 …
直接写出得数.0.5×4÷0.5×4=4.2-4.2×0.5=1.2÷4×1.2÷4=6.3+6.3 2020-11-19 …
直接写出得数9+7.8-3.8=5÷2×0.8=0.7+0.4×1.5=2.4-2.4÷1.2=0. 2020-11-19 …
直接写得数:0.06×0.25=0.8×1.25=10-0.01=8.1÷0.03=3×0.2×0. 2020-11-19 …