Why cannot IE parse this string as a Date object.
var d = Date.parse("Fri Jun 11 04:55:12 +0000 2010"); // returns NaN
However, it works well in FireFox. I am running IE 8.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are getting
NaNvalue in IE 8 and its working in Firefox because the format of the string varies with browser and operating system.For example, in IE6 for Windows XP, the string is in the following format:
But in Firefox for Windows XP, the string is
to make it compatible with both browser you will have to first check the browser in your
javascript code and then accordingly give your input date string.