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


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">
<meta charset="utf-8">
<title>JavaScript date.setUTCDate Method</title>
  <script type = "text/javascript">
     var date = new Date( "Nov 24, 2019 22:32:50" );
     date.setUTCDate( 20 );
     document.write( "The javascript date.setUTCDate() : " + date );

Output of the above code is:

JavaScript date.setUTCDate Method


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

Recommended JavaScript Tutorials

Leave a Comment