javascript date comparison

Posted by ash34 on Stack Overflow See other posts from Stack Overflow or by ash34
Published on 2010-05-02T05:29:54Z Indexed on 2010/05/02 5:37 UTC
Read the original article Hit count: 488

Filed under:

Hi,

I haven't done much js. I am trying to compare two dates. From jconsole

a = ["01/01/2010","01/02/2010","01/03/2010"]

date1 = new Date('01/02/2010')
Sat Jan 02 2010 00:00:00 GMT-0800 (PST)

date2 = new Date(a[1])
Sat Jan 02 2010 00:00:00 GMT-0800 (PST)

date1 == date2
false

Can someone tell me why this does not match?

thanks.

© Stack Overflow or respective owner

Related posts about JavaScript