JavaScript Date setUTCDate() Method

setUTCDate method in javascript; Through this tutorial, i am going to show you how to set utc date in javascript using setUTCDate() with the help of examples.

JavaScript setUTCDate() Method

Javascript setUTCDate() method, which is used to sets the day of the month for a specified date according to universal time.

Syntax of JavaScript setUTCDate() Method

 Date.setUTCDate(day_value) 

Note :- day_value − it is an integer value from 1 to 31. This is representing the day of the month.

Example of JavaScript setUTCDate() Method

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JavaScript date.setUTCDate Method</title>
</head>
<body>
  <script type = "text/javascript">
     var date = new Date( "Nov 24, 2019 22:32:50" );
     date.setUTCDate( 20 );
     document.write( "The javascript date.setUTCDate() : " + date );
  </script>  
</body>
</html>

Output of the above code is:

JavaScript date.setUTCDate Method

Conclusion

In this javascript set UTC date tutorial, you have learned how to set UTC date javascript with example.

Recommended JavaScript Tutorials

Be First to Comment

Leave a Reply

Your email address will not be published.