MomentJS - Minute


Advertisements

This method will get/set the minutes. It takes input from 0-59, if greater than the range provided, then it will add to the hour.

Syntax

moment().minute(Number);
moment().minute();
moment().minutes(Number);
moment().minutes();

Example

var m = moment().minute(); // gets the current minute
var d = moment().minute(5); // sets the minute as shown below

Output

Minute
momentjs_getter_setter.htm
Advertisements