Years1.6.0+

  1. moment.duration().years();
  2. moment.duration().asYears();

As with the other getters for durations, moment.duration().years() gets the years.

moment.duration().asYears() gets the length of the duration in years.