setUTCMinutes()
Date
instance method setterS2C Home
« Globals « Date « setUTCMinutes()
Description
Sets the UTC minute of the hour (0-59) for the specified date.
Syntax
Signature | Description |
---|---|
aDate.setUTCMinutes(minutesInt [, secondsInt[, millisecondsInt]]) | Sets the UTC minute of the hour (0-59) for the specified date. |
Parameters
Parameter | Description |
---|---|
minutesInt | An integer in the range 0-59. |
secondsInt | An integer in the range 0-59.
|
millisecondsInt | An integer in the range 0-999.
|
For specified values outside the ranges above the setUTCMinutes() method will try and set the date accordingly. |
Examples
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();
alert(todaysDate);
// Set UTC minutes.
todaysDate.setUTCMinutes(45);
alert(todaysDate + ' - UTC Minutes set to 45');
// Set UTC minutes and seconds.
todaysDate.setUTCMinutes(25,15);
alert(todaysDate + ' - UTC Minutes and seconds set');
Related Tutorials
JavaScript Intermediate Tutorials - Lesson 2 - Dates and Times