new Date() works differently in Chrome and Firefox

前端 未结 5 1644
走了就别回头了
走了就别回头了 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:10

    Try using moment.js. It goes very well and in similar fashion with all the browsers. comes with many formatting options. use moment('date').format("") instead of New Date('date')

提交回复
热议问题