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…but nothing…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This would do it for simple scenarios like the one you have:
Essentially, we create an empty Date object and set the year, month, and date with the
setFullYear()function. We then grab the timestamp from that date usinggetTime()and add 1 day (86400000 milliseconds) to it and set it back to the date using thesetTime()function.If you need something more complicated than this, like support for different formats and stuff like that, you should take a look at the datejs library which does quite a bit of work for you.