Availability: |
| ||||||
Property/method value type: | Time value | ||||||
JavaScript syntax: | - | myDate.setUTCMinutes(aMinutesValue) | |||||
- | myDate.setUTCMinutes(aMinutesValue, aSecondsValue) | ||||||
- | myDate.setUTCMinutes(aMinutesValue, aSecondsValue, aMillisecondsValue) | ||||||
Argument list: | aMillisecondsValue | An optional value between 0 and 999 milliseconds | |||||
aMinutesValue | A value between 0 and 59 minutes | ||||||
aSecondsValue | An optional value between 0 and 59 seconds |
The computation is done according to UTC time coordinates.
ECMA mandates that the seconds and milliseconds should be optional arguments. If the milliseconds value is omitted, the current milliseconds value is used as if the value had been supplied with a getUTCMilliseconds() method. Likewise, the seconds value behaves as if it had been supplied by a getUTCSeconds() method, if it is missing.
The result of this method is the new time value of the containing object having been adjusted by the values passed in as arguments.
<HTML> <HEAD></HEAD> <BODY> <SCRIPT> myDate = new Date(); myDate.setUTCMilliseconds(0); myDate.setUTCSeconds(0); myDate.setUTCMinutes(0); myTime = myDate.getTime(); document.write("The time rounded down to the nearest hour is " + myTime + " Milliseconds"); </SCRIPT> </BODY> </HTML>
Prev | Home | Next |
Date.setUTCMilliseconds() | Up | Date.setUTCMonth() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |