Seconds1.6.0+

  1. moment.duration().seconds();
  2. moment.duration().asSeconds();

To get the number of seconds in a duration, use moment.duration().seconds().

It will return a number between 0 and 59.

  1. moment.duration(500).seconds(); // 0
  2. moment.duration(1500).seconds(); // 1
  3. moment.duration(15000).seconds(); // 15

If you want the length of the duration in seconds, use moment.duration().asSeconds() instead.

  1. moment.duration(500).asSeconds(); // 0.5
  2. moment.duration(1500).asSeconds(); // 1.5
  3. moment.duration(15000).asSeconds(); // 15