Tutorials Point


  JavaScript Basics
  JavaScript Objects
  JavaScript Advanced
  JS Useful References
  JS Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

Javascript Date setUTCDate() Method


previous next AddThis Social Bookmark Button


Advertisements

Description:

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

Syntax:

Date.setUTCDate(dayValue)

Note: Paramters in the bracket are always optional

Here is the detail of parameters:

  • dayValue : An integer from 1 to 31, representing the day of the month.

If a parameter you specify is outside of the expected range, setUTCDate attempts to update the date information in the Date object accordingly.

Return Value:

NA

Example:

<html>
<head>
<title>JavaScript setUTCDate Method</title>
</head>
<body>
<script type="text/javascript">
   var dt = new Date( "Aug 28, 2008 23:30:00" );
   dt.setUTCDate( 20 );
   document.write( dt ); 
</script>
</body>
</html>

This will produce following result :

Wed Aug 20 23:30:00 UTC+0530 2008 

To understand it in better way you can Try it yourself.



previous next Printer Friendly

Advertisements


  

Advertisements