HourFromTime.js 382 B

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