I\'ve a var example = \"05-10-1983\"
How I can get the \"next day\" of the string example?
I\'ve try to use Date object...b
The problem with the +86400000 approach is the potential for error when crossing a daylight savings time barrier. For example, I'm on EST. If I do this:
var d = new Date("11/04/2012 00:00:00");
var e = new Date(d.getTime() + 86400000);
e is going to be 11/4/2012 23:00:00 If you then extract just the date portion, you get the wrong value. I recently hit upon this issue while writing a calendar control.
this will do it better (and with a flexible offset which will let you do more than 1 day in the future):
function getTomorrow(d,offset) {
if (!offset) { offset = 1 }
return new Date(new Date().setDate(d.getDate() + offset));
}