JavaScript setUTCMilliseconds()

The JavaScript date setUTCMilliseconds() method sets the millisecond value for the particular date on the basis of universal time.

Syntax:

dateObj.setUTCMilliseconds(new_milliseconds);

Parameters:
new_milliseconds: Integer value between 0 to 999. If its value is greater than 999 then the second value will increase accordingly.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var today =new Date();
document.writeln(today.getUTCMilliseconds()+"<br>");
today.setUTCMilliseconds(500);
document.writeln(today.getUTCMilliseconds());
</script>
</body>
</html>