setUTCMinutes()  Date  instance method JS Home  <<  JS Reference  <<  Date  <<  setUTCMinutes()


Sets the UTC minute of the hour (0-59) for the specified date.


Signature Description
aDate.setUTCMinutes(minutesInt [, secondsInt[, millisecondsInt]])Sets the UTC minute of the hour (0-59) for the specified date.


Parameter Description
minutesIntAn integer in the range 0-59.
secondsIntAn integer in the range 0-59.
  • If secondsInt is not specified the value returned from the getUTCSeconds() method is used.
millisecondsIntAn integer in the range 0-999.
  • If millisecondsInt not specified value returned from the getUTCMilliseconds() method is used.
  • If millisecondsInt is specified you must also specify secondsInt.
For specified values outside the ranges above the setUTCMinutes() method will try and set the date accordingly.


The code below shows examples of the setUTCMinutes() method of Date.

// Create a Date instance for the current date and time.
var todaysDate = new Date();

// Set UTC minutes.
alert(todaysDate + ' - UTC Minutes set to 45');

// Set UTC minutes and seconds.
alert(todaysDate + ' - UTC Minutes and seconds set');

Press the button below to action the above code:

Related Tutorials

JavaScript Intermediate Tutorials - Lesson 2 - Dates and Times