Home > Article > Web Front-end > The use of setUTCMinutes() method for processing time in JS_Basic knowledge
The javascript Date.setUTCMinutes() method sets minutes to a specified date according to universal time.
Grammar
Date.setUTCMinutes(minutesValue[, secondsValue[, msValue]])
Note: The data inside and outside the brackets are optional
Here are the details of the parameters:
If the secondsValue and msValue parameters are not specified, the values returned from the getUTCSeconds and getUTCMilliseconds methods are used.
If the specified parameter is outside the expected range, setUTCMinutes attempts to update the latest information of the Date object accordingly. For example, if secondsValue uses 100, minutes(minutesValue) will be incremented by 1(minutesValue 1) and 40 will be used for seconds.
Return value:
Example:
<html> <head> <title>JavaScript setUTCMinutes Method</title> </head> <body> <script type="text/javascript"> var dt = new Date( "Aug 28, 2008 13:30:00" ); dt.setUTCMinutes( 65 ); document.write( dt ); </script> </body> </html>
This will produce the following results:
Thu Aug 28 14:35:00 UTC+0530 2008