How to extract the number of minutes from current time in JavaScript?

JavascriptWeb DevelopmentFront End Technology

To extract a number of minutes in JavaScript, use the getMinutes() method. JavaScript date getMinutes() method returns the minutes in the specified date according to local time. The value returned by getMinutes() is an integer between 0 and 59.

Example

You can try to run the following code to learn how to extract minutes from current time −

Live Demo

<html>
   <head>
      <title>JavaScript getMinutes Method</title>
   </head>
   <body>
      <script>
         var dt = new Date( "December 30, 2017 20:30:00" );
         document.write("getMinutes() : " + dt.getMinutes() );
      </script>
   </body>
</html>

Output

getMinutes() : 30
raja
Published on 12-Feb-2018 13:23:42
Advertisements