Javascript examples for jQuery:Date
Add to current date with javascript and have months roll over
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.js"></script> <script type="text/javascript"> $(function(){/*w w w . j ava2s. c o m*/ var today = new Date(); var addDays = 2; var addMs = addDays * 24 * 60 * 60 * 1000; var newDate = new Date(); newDate.setTime(today.getTime() + addMs); console.log(newDate); }); </script> </head> <body> </body> </html>