Thursday, 12 September 2013

Javascript Date string constructing wrong date

Javascript Date string constructing wrong date

Hi I am trying to construct a javascript date object with a string, but it
keeps contructing the wrong day. It always constructs a day that is one
day behind. Here is my code
var date = new Date('2006-05-17');
The date i want to get is
Wednesday May 17 2006 00:00:00 GMT-0700 (PDT)
But instead I get
Tue May 16 2006 17:00:00 GMT-0700 (PDT)

No comments:

Post a Comment