CodesJava

Easy learning with example program codes

JavaScript setUTCSeconds() method

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

Syntax:

dateObj.setUTCSeconds(new_seconds);

Parameters:
new_seconds: Integer value between 0 to 59.

Example:

<!DOCTYPE html>
<html>
<body>
<script> 
var today =new Date(); 
document.writeln(today.getUTCSeconds()+"<br>"); 
today.setUTCSeconds(40); 
document.writeln(today.getUTCSeconds()); 
</script> 
</body>
</html>

Output:

41
40
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status