新日期(“2001/1/1 0:0:0R”) [英] new Date("2001/1/1 0:0:0R")

查看:139
本文介绍了新日期(“2001/1/1 0:0:0R”)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Javascript日期字符串可以有一个字母的后缀;它被视为

表示时区(不是J,导致NaN)。

// IIRC,VB接受A& P在该位置,对于AM& PM。


在我的MS IE 4中,新日期生成的对象(2001/1/1 0:0:0R)

价值含义Sun Dec 31 19:00:00 UTC 2000.


当地时间和UTC的组合对应,AIUI,塔什干

和卡拉奇,亚洲(而不是任何同名的美国城镇)。


RFC 0822授权新闻/邮件标题中的符号,显然具有

的意义。


但是,AIUI,美国军方使用时区后缀字母,

反义 - R罗密欧是美国东海岸的冬季时间(并且

我认为J是本地时间。


RFC 2822说0822错了,因此不允许使用
$ b $中的符号b标题。


ECMA 262似乎没有定义日期字符串的内容。

其他浏览器为新日期显示什么(< 2001/1 / 1 0:0:0R")?

< URL:http://www.merlyn.demon.co.uk/mi sctime.htm#Zones>,

< URL:http://www.merlyn.demon.co.uk/js-date0.htm#TP>。


-

?约翰斯托克顿,英国萨里。 ?@merlyn.demon.co.uk Turnpike v4.00 MIME。 ?

Web< URL:http://www.merlyn.demon.co.uk/> - w。常见问题主题,链接,首字母缩略词

PAS EXE等:< URL:http://www.merlyn.demon.co.uk/programs/> - 见00index.htm

日期 - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm等


Javascript date strings can have a one-letter postfix; it is taken as
indicating time zone (not J, which causes NaN).
// IIRC, VB accepts A & P in that location, for AM & PM.

In my MS IE 4, the object generated by new Date("2001/1/1 0:0:0R")
has value meaning Sun Dec 31 19:00:00 UTC 2000.

That combination of local time and UTC corresponds, AIUI, to Tashkent
and Karac in Asia (and not to any US towns of the same name).

RFC 0822 authorises that notation in news/mail headers, apparently with
that sense.

However, AIUI, the US military use letter postfixes for time zones, in
the inverse sense - R Romeo being Winter Time on the US East Coast (and
I think J being Local Time).

RFC 2822 says 0822 got it wrong, and therefore disallows the notation in
headers.

ECMA 262 seems not to define the contents of date strings.
What do other browsers show for new Date("2001/1/1 0:0:0R") ?
<URL:http://www.merlyn.demon.co.uk/misctime.htm#Zones>,
<URL:http://www.merlyn.demon.co.uk/js-date0.htm#TP>.

--
? John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ?
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.

推荐答案

2004年10月4日星期一21:28:03 +0100,John Stockton博士写道:
On Mon, 4 Oct 2004 21:28:03 +0100, Dr John Stockton wrote:
其他浏览器为新日期显示什么(2001 / 1/1 0:0:0R")?
What do other browsers show for new Date("2001/1/1 0:0:0R") ?




在地址区域使用此字符串..

javascript :新日期(2001/1/1 0:0:0R)


我得到了...

IE 6.0026"周一1月1日06:00:00 UTC + 1100 2001

Moz。 1.7.2无效日期

Opera 6.54" Mon,01 Jan 2001 00:00:00 GMT + 1100"

NN 4.78无效日期


那是大约上午8点29分,2004年10月5日星期二,如果这是相关的

(实际上即使是那个时候也是如此)没有关系)


HTH


-

Andrew Thompson
http://www.PhySci.org/codes/ Web& IT帮助
http://www.PhySci.org/ 开源软件套件
http://www.1point1C.org/ Science&技术
http://www.lensescapes.com/ 图像逃脱mundane



using this string in the address area..
javascript:new Date("2001/1/1 0:0:0R")

I got...
IE 6.0026 "Mon Jan 1 06:00:00 UTC+1100 2001"
Moz. 1.7.2 "Invalid Date"
Opera 6.54 "Mon, 01 Jan 2001 00:00:00 GMT+1100"
NN 4.78 "Invalid Date"

That was about 8:29am, Tue 5th Oct 2004, if that''s relevant
(..actually it was about that time even if it''s not relevant)

HTH

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane


2004年10月4日星期一21:28:03 +0100,John Stockton博士

< sp ** @ merlyn.demon .co.uk>写道:


[snip]
On Mon, 4 Oct 2004 21:28:03 +0100, Dr John Stockton
<sp**@merlyn.demon.co.uk> wrote:

[snip]
其他浏览器为新日期显示什么(2001/1/1 0:0:0R ;)?
What do other browsers show for new Date("2001/1/1 0:0:0R") ?




使用:document.write(new Date(" 2001/1/1 0:0:0R"));


Opera 7.54:2001年1月1日星期一00:00:00 GMT + 0000

IE 6.0.2900.2180:Sun Dec 31 19:00:00 UTC 2000

Gecko [1]:无效日期

NN4:无效日期


Mike

[1]所有主要的Mozilla版本从1.0到1.7,再加上1.7.3。还包括

Firefox 0.9.3和Netscape 7.2。


-

Michael Winter

替换.invalid与.uk通过电子邮件回复。



Using: document.write(new Date("2001/1/1 0:0:0R"));

Opera 7.54: Mon, 01 Jan 2001 00:00:00 GMT+0000
IE 6.0.2900.2180: Sun Dec 31 19:00:00 UTC 2000
Gecko[1]: Invalid Date
NN4: Invalid Date

Mike
[1] All major Mozilla versions from 1.0 to 1.7, plus 1.7.3. Also includes
Firefox 0.9.3 and Netscape 7.2.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


Michael Winter写道:

[snip]
Michael Winter wrote:
[snip]
使用:document.write (新日期(2001/1/1 0:0:0R));

Opera 7.54:2001年1月1日星期一00:00:00 GMT + 0000
IE 6.0 .2900.2180:Sun Dec 31 19:00:00 UTC 2000
Gecko [1]:无效日期
NN4:无效日期
Using: document.write(new Date("2001/1/1 0:0:0R"));

Opera 7.54: Mon, 01 Jan 2001 00:00:00 GMT+0000
IE 6.0.2900.2180: Sun Dec 31 19:00:00 UTC 2000
Gecko[1]: Invalid Date
NN4: Invalid Date



和Safari 1.0.3 (v85.8):


document.write(新日期(" 2001/1/1 0:0:0R"));


给出:


Sun 10月25日1959 00:00:00 GMT + 1000

不管尾随字符(R,S,T,Z ,G,''''测试过)


弗雷德。


and in Safari 1.0.3 (v85.8):

document.write(new Date("2001/1/1 0:0:0R"));

gives:

Sun Oct 25 1959 00:00:00 GMT+1000
regarless of the trailing character (R,S,T,Z,G,'''' tested)

Fred.


这篇关于新日期(“2001/1/1 0:0:0R”)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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