JavaScript setMilliseconds()

The JavaScript date setMilliseconds() method sets the millisecond value for a particular date on the basis of local time.

Syntax:

dateObj.setMilliseconds(new_milliseconds);

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

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var bday =new Date("November 16, 1994 21:00:10");
bday.setMilliseconds(478);
document.writeln(bday.getMilliseconds());
</script>
</body>
</html>