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

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

PHPz
Release: 2023-09-09 19:17:06
forward
788 people have browsed it

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

JavaScript Date setUTCMinutes() Method sets the minutes of the specified date based on world time.

The following are the parameters of setUTCMinutes(minesValue[, secondaryValue)[, msValue]]) method-

  • ##minesValue - an integer between 0 and 59, Indicates minutes.
  • secondsValue - An integer between 0 and 59 representing seconds. If you specify a seconds parameter, you must also specify a minute value.
  • msValue - A number between 0 and 999 representing milliseconds. If the msValue parameter is specified, the minutes and seconds values ​​must also be specified.
Example

You can try running the following code to set a date with a specified number of minutes based on world time -

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

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

The above is the detailed content of Sets the number of minutes 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