|
| JAVASCRIPT setUTCMilliseconds() METHOD
The setUTCMilliseconds() method in javascript returns the date and time in UTC (Universal Coordinated Time) by setting the milliseconds. Takes a compulsory milliseconds argument as a number from 0 to 999.
The general format is:
dateObject.setUTCMilliseconds(milliseconds);
If you want to return the full date and time with the setUTCMilliseconds() method, you will first have to create a new date object and then use the new date object with the setUTCMilliseconds() method.
Example:
<script type="text/javascript">
var dd=new Date(); // creates a new date object
dd.setUTCMilliseconds(48); // sets the date/time
document.write(dd); // outputs the date/time
</script>
The above will output:
See Also:
|
|