夏令时 [英] Daylight Saving Time

查看:116
本文介绍了夏令时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力了解2007年美国夏令时规则的影响

的变化。谁能告诉我Javascript如何知道

何时在以下脚本中应用夏令时?


d1 =新日期(2006,03,01,23 ,00);

d2 =新日期(2006年,03年,02年,04年,00年);

//报告这是好的:答案应该是4它是4。

警告(这是好的:答案应该是4.它是+(((d2.valueOf()

- d1.valueOf())/ 1000)/ 60)/ 60);


我告诉它我在东海岸并且DST

适用。 Javascript如何知道进行预期的调整?


谢谢,

乔治

I''m trying to understand the effects of the Daylight Saving Time rule
changes for 2007 in the US. Can anyone tell me how Javascript knows
when to apply Daylight Saving Time in the following script?

d1 = new Date(2006, 03, 01, 23, 00);
d2 = new Date(2006, 03, 02, 04, 00);
// Reports "This is ok: The answere should be 4. It is 4".
alert("This is ok: The answer should be 4. It is " + (((d2.valueOf()
- d1.valueOf())/1000)/60)/60);

Nowhere did I tell it that I was on the east coast and that DST
applies. How did Javascript know to make the expected adjustment?

Thanks,
George

推荐答案

geolev于2006年8月16日在comp.lang.javascript中写道
geolev wrote on 16 aug 2006 in comp.lang.javascript:

我没有告诉它我在东海岸,DST

适用。 Javascript是如何知道进行预期调整的?
Nowhere did I tell it that I was on the east coast and that DST
applies. How did Javascript know to make the expected adjustment?



当你安装Windows时,你做了以后可能会改变它。


你的时区和夏令时区是在Windows中设置,

和javascript只是从那里获取当地时间[规则]。


我想MS会在更新时向您发送本地更改。


-

Evertjan。

荷兰。

(请更改x'我的电子邮件地址中的点数。

You did, when you installed Windows, and perhaps changed it later.

Your time zone and the DST area are set in Windows,
and javascript just gets the local time [rules] from there.

I suppose MS will send you/us local changes in an update.

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


啊。我猜这是我真正的问题。


浏览器必须调用OS API来确定TZ以及是否适用DST

。然后浏览器必须将它提供给Javascript

引擎。


任何人都可以确认这确实是如何工作的吗?

感谢Evertjan的快速回复。


geolev


Evertjan。写道:
Ah. I guess that was my real question.

The browser must call an OS API to determine the TZ and whether DST
applies. Then the browser must make this available to the Javascript
engine.

Can anyone confirm that this is indeed how it works?

Thanks Evertjan for the quick response.

geolev

Evertjan. wrote:

geolev于2006年8月16日在comp.lang.javascript中写道

我告诉它我在东海岸并且DST

适用。 Javascript是如何知道进行预期调整的?
Nowhere did I tell it that I was on the east coast and that DST
applies. How did Javascript know to make the expected adjustment?



当你安装Windows时,你做了以后可能会改变它。


您的时区和DST区域是在Windows中设置,

和javascript只是从那里获取当地时间[规则]。


我想MS会在更新时向您发送本地更改。


-

Evertjan。

荷兰。

(请更改x' 我的电子邮件地址中的点数


You did, when you installed Windows, and perhaps changed it later.

Your time zone and the DST area are set in Windows,
and javascript just gets the local time [rules] from there.

I suppose MS will send you/us local changes in an update.

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


geolev于2006年8月16日在comp.lang.javascript中写道
geolev wrote on 16 aug 2006 in comp.lang.javascript:

Evertjan。写道:
Evertjan. wrote:

> geolev于2006年8月16日在comp.lang.javascript中写道

我告诉它我在东海岸并且DST

适用。 Javascript是如何知道进行预期调整的?
Nowhere did I tell it that I was on the east coast and that DST
applies. How did Javascript know to make the expected adjustment?


当你安装Windows时,你做了以后可能会改变它。

您的时区和DST区域在Windows中设置,
并且javascript只是从那里获得当地时间[规则]。

我想MS会在更新时向您发送本地更改。


You did, when you installed Windows, and perhaps changed it later.

Your time zone and the DST area are set in Windows,
and javascript just gets the local time [rules] from there.

I suppose MS will send you/us local changes in an update.



啊。我想那是我真正的问题。

Ah. I guess that was my real question.



[请不要在usenet上使用]

[请不要在报价中包含签名]

[please do not toppost on usenet]
[please do not include signature in the quote]


浏览器必须调用OS API来确定TZ以及是否适用DST

。然后浏览器必须将其提供给Javascript

引擎。


任何人都可以确认这确实是如何工作的吗?
The browser must call an OS API to determine the TZ and whether DST
applies. Then the browser must make this available to the Javascript
engine.

Can anyone confirm that this is indeed how it works?



您可以通过暂时更改时区设置轻松尝试。


" browser"? javascript / jscript也可以在IE浏览器之外工作,

就像在wscript和IIS中一样。


在FF等我不知道。


-

Evertjan。

荷兰。

(请将x''es更改为圆点在我的电子邮件地址)

You can easily try it by temporarily changing your timezone settings.

"browser"? javascript/jscript can also work outside the IE-browser,
like in wscript and IIS.

In FF, etc I would not know.

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


这篇关于夏令时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆