MomentJS - As Unit of Time



This method is the alternative to the method used asHours, asMonths, asYears etc.

Syntax

moment.duration().as(String);

Example

var d = moment.duration(500, 'days').as('days');

Output

Units
momentjs_durations.htm
Advertisements