SecFromTime.js 402 B

1234567891011121314
  1. 'use strict';
  2. var floor = require('./floor');
  3. var modulo = require('./modulo');
  4. var timeConstants = require('../helpers/timeConstants');
  5. var msPerSecond = timeConstants.msPerSecond;
  6. var SecondsPerMinute = timeConstants.SecondsPerMinute;
  7. // https://262.ecma-international.org/5.1/#sec-15.9.1.10
  8. module.exports = function SecFromTime(t) {
  9. return modulo(floor(t / msPerSecond), SecondsPerMinute);
  10. };