new Date() works differently in Chrome and Firefox

前端 未结 5 1640
走了就别回头了
走了就别回头了 2020-11-22 15:31

I want to convert date string to Date by javascript, use this code:

var date = new Date(\'2013-02-27T17:00:00\');
alert(date);

5条回答
  •  执念已碎
    2020-11-22 16:06

    I found one thing here. It seems the native Firefox Inspector Console might have a bug: If I run "new Date()" in the native Inspector, it shows a date with wrong timezone, GMT locale, but running the same command in the Firebug Extension Console, the date shown uses my correct timezone (GMT-3:00).

提交回复
热议问题