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.


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

Live Demo

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


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