JavaScript Date setDate()

The JavaScript date setDate() method sets the date value for a particular date on the basis of local time.

Syntax:

dateObj.setDate(new_Date);

Parameters:
new_Date: Integer value between 1 to 31.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var bday =new Date("March 13, 1987 21:00:10");
document.writeln(bday.getDate() + "<br>");
bday.setDate(23);
document.writeln(bday.getDate());
</script>
</body>
</html>