JavaScript setUTCDate() method

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

Syntax:

dateObj.setUTCDate(new_date);

Parameters:
new_Date: Integer value between 1 to 31.

Example:

<!DOCTYPE html>
<html>
<body>
<script>  
var today =new Date();  
document.writeln(today.getUTCDate()+"<br>");  
today.setUTCDate(31);  
document.writeln(today.getUTCDate());  
</script>  
</body>
</html>

Output:

1
31
Please Share