CodesJava

Easy learning with example program codes

JavaScript setUTCMonth() method

The JavaScript date setUTCMonth() method sets the month value for the particular date on the basis of universal time.

Syntax:

dateObj.setUTCMonth(new_month);

Parameters:
new_Date: Integer value between 0 to 11.

Example:

<!DOCTYPE html>
<html>
<body>
<script> 
var today =new Date(); 
document.writeln(today.getUTCMonth()+"<br>"); 
today.setUTCMonth(4); 
document.writeln(today.getUTCMonth()); 
</script> 
</body>
</html>

Output:

11
4
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status