You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HourFromTime.js 447B

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