Javascript date setUTCMonth ( ) method sets the month for a specified date according to universal time.
The following syntax for setUTCMonth ( ) Method.
Date.setUTCMonth ( monthvalue )
Note − Parameters in the bracket are always optional.
monthValue − An integer between 0 and 11, representing the month.
Try the following example.
<html> <head> <title>JavaScript getUTCSeconds Method</title> </head> <body> <script type="text/javascript"> var dt = new Date( "Aug 28, 2008 13:30:00" ); dt.setUTCMonth( 2 ); document.write( dt ); </script> </body> </html>
Fri Mar 28 2008 13:30:00 GMT+0530 (India Standard Time)