CodesJava

Easy learning with example program codes

JavaScript JS Date setDate() method


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

Syntax:

dateObj.setDate(new_Date);

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>

Output:

13
23
Please follow and like us:


Copyright © 2019 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki