tags:

views:

50

answers:

2

Hi, We are trying parse the date with timestamp string, it blows up in IE but works fine FireFox.

Here are the code

alert(new Date(Date.parse("2010-01-31T12:00:00.233467-05:00")));

Any idea to make it work in IE browser? Thanks in advance.

A: 

If you can put your input in this form:

YYYY/MM/DDThh:mm:ss

It will work.

Eg:

alert(new Date(Date.parse('2010-01-31T12:00:00.233467-05:00'.replace(/\-/ig, '/').split('.')[0])));

If you want the time zone, then you will have to find another way

Bob Fincheimer
A: 

In the above example, we are stripping of the Time portion. but IE8 blows up for YYYY/MM/DDThh:mm:ss format. any idea?

Senthil Elayappan