ES6 - setUTCMonth() Method


Advertisements


JavaScript date setUTCMonth() method sets the month for a specified date according to universal time.

Syntax

Date.setUTCMonth ( monthvalue )      

Parameter

  • monthValue − An integer between 0 and 11, representing the month.

Example

var dt = new Date( "Aug 28, 2008 23:30:00" ); 
dt.setUTCMonth(5);
console.log( dt );         

Output

Sat Jun 28 2008 23:30:00 GMT+0530 (India Standard Time)         

es6_date.htm

Advertisements