CodesJava

Easy learning with example program codes

JavaScript setUTCMilliseconds() method

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 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>

Output:

958
500
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status