Latest web development tutorials

JavaScript getMinutes () method

Date Object Reference JavaScript Date Object

Examples

Local time according to the number of minutes return time:

var d = new Date();
var n = d.getMinutes();

n output:


try it"

Definition and Usage

getMinutes () method to return the minutes field time.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support getMinutes () method


grammar

Date.getMinutes()

return value

Type 描述
Number date Object 的分钟字段,以本地时间显示。返回值是 0 ~ 59 之间的一个整数。

technical details

JavaScript version: 1.0


More examples

Examples

Returns the number of minutes to set the date and time:

var d = new Date("July 21, 1983 01:15:00");
var n = d.getMinutes();

n output:

15

try it"
Examples s

Displays the current time
How getHours (), getMinutes () and getSeconds () to display the current time.


Date Object Reference JavaScript Date Object