I would like to retrieve a Javascript object Date for new year. I want to user new Date(); object and init it to the 2009-01-01 (it's for a countdown).
Thanks
I would like to retrieve a Javascript object Date for new year. I want to user new Date(); object and init it to the 2009-01-01 (it's for a countdown).
Thanks
From http://www.w3schools.com/js/js_obj_date.asp, you can init your js date object with
var date= new Date(year, month, day, hours, minutes, seconds, milliseconds);
You may also use date.setFullYear(year,month,day) method if your date object has been created before. Please note that month is between 0 and 11 just like what David Hedlund said.