Year1.0.0+

  1. moment().year(Number);
  2. moment().year(); // Number
  3. moment().years(Number);
  4. moment().years(); // Number

Gets or sets the year.

Accepts numbers from -270,000 to 270,000.

2.6.0 deprecated using moment().years(). Use moment().year() instead.