Current and New Date


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script type="text/javascript">
  2. var newDt = new Date();
  3. document.writeln("<b>Current Date</b> :" + newDt + "<br/>");
  4. // add 3 days to the current date
  5. newDt.setDate(newDt.getDate() + 3);
  6. document.writeln("<b>New Date</b> :" + newDt);
  7. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.