Home > Web Front-end > HTML Tutorial > Sets the number of seconds for a specified date based on UTC

Sets the number of seconds for a specified date based on UTC

WBOY
Release: 2023-09-14 14:09:03
forward
1445 people have browsed it

Sets the number of seconds for a specified date based on UTC

JavaScript date setUTCSeconds() Method sets the seconds of the specified date based on Coordinated Universal Time.

setUTCSeconds(secondsValue[, msValue]) The parameters of the method are as follows:

  • secondsValue - an integer between 0 and 59, representing the number of seconds .
  • msValue - A number between 0 and 999 representing the number of milliseconds.

Example

You can try running the following code to set the seconds of a specified date:

<html>
   <head>
      <title>JavaScript setUTCSeconds Method</title>
   </head>

   <body>
      <script>
         var dt = new Date( "Aug 28, 2008 13:30:00" );
         dt.setUTCSeconds( 65 );
         document.write( dt );
      </script>
   </body>
</html>
Copy after login

The above is the detailed content of Sets the number of seconds for a specified date based on UTC. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template