开发者

How is Javascript Date handled in other languages?

开发者_如何转开发

I don't have the liberty of testing my Javascript on a foreign operating system. I would like to know if the following will work globally:

var d = new Date(
   'Tue Aug 20 2011 16:00:00 GMT-0700 (Pacific Daylight Time)'
);

If a Spanish OS were to run this, would it crash? Would I have to use this instead?

var d = new Date(
   'Mar Ago 20 2011 16:00:00 GMT-0700 (Pacífico Hora de verano)'
);

I use strings to initialize Date because I hate using the numerical approaches which all require translating into UTC.


No. The string format is strict about language. English only. I have a Hebrew OS and I use English just fine. (Trying Hebrew crashes it).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜