I was trying to create a JavaScript calendar, but when I try to increment the days, I get a problem which seems to be the daylight savings change. For example, when I try to increment the days in March 2012 (myDate.setDate(myDate.getDate() + 1); I get 2 days of 24, 24 march 2012 0:00 and 24 march 2012 23:00 (I hope I remember correctly and it’s 24). This happens only on some PCs (probably the ones who have it enabled on the operating system).
My question is, can I remove the auto daylight increment and use the date variable just to store the date and time datas and make it disabled to auto increment / decrement the numbers.
Thank you, Daniel!
using .setUTCDate() and .getUTCDate() will set and get the day of the month ignoring the timezone offset but lanzz is right that we’d need to see how you are initialising the myDate variable.