Date.parse() is not working in Fire Fox and IE.Its working fine in Chrome
问题 How to convert the string which is having date time to date time format. My code is: In Chrome its working fine: var str = "05-Sep-2013 01:05:15 PM " var res = Date.parse(str) console.log(res) //o/p:1378366515000 var result = new Date(res) console.log(result) //o/p:Thu Sep 05 2013 13:05:15 GMT+0530 (India Standard Time) In Firefox and IE: console.log(res) //o/p: NaN console.log(result) //o/p: Date {Invalid Date} Could you please help me out. thanks in advance. 回答1: Parse the string yourself