Javascript date setUTCDate() method sets the day of the month for a specified date according to universal time.
Its syntax is as follows −
Date.setUTCDate(dayValue)
Note − Parameters in the bracket are always optional.
dayValue − An integer from 1 to 31, representing the day of the month.
Try the following 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>
Wed Aug 20 2008 23:30:00 GMT+0530 (India Standard Time)