Now you can listen to this article with the Online Text Reader

JavaScript getMinutes Method

The getMinutes method returns the minutes value of the point in time stored in a Date object. The value returned by this method is an integer number from 0 to 59.



With myDate being an object based on the Date object


The following code uses the getMinutes method to return the minutes of the current instant of time:

<script type="text/javascript">

var currentTime = new Date();
var currentMinutes = currentTime.getMinutes();

document.write("The minutes passed since the last hour are: " + currentMinutes + ".");


Technical Details

The getMinutes method belongs to the Date object, it is available since the version 1.0 of JavaScript, and it is supported in all major browsers.

JavaScript Manual >> Date Object >> getMinutes Method

© Copyright 2010-2018 ROM Cartridge

Books to Read and Listen to Online