Blame view

天文台pc/tianwentai-ui/node_modules/date-fns/secondsToHours.js 701 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  "use strict";
  exports.secondsToHours = secondsToHours;
  var _index = require("./constants.js");
  
  /**
   * @name secondsToHours
   * @category Conversion Helpers
   * @summary Convert seconds to hours.
   *
   * @description
   * Convert a number of seconds to a full number of hours.
   *
   * @param seconds - The number of seconds to be converted
   *
   * @returns The number of seconds converted in hours
   *
   * @example
   * // Convert 7200 seconds into hours
   * const result = secondsToHours(7200)
   * //=> 2
   *
   * @example
   * // It uses floor rounding:
   * const result = secondsToHours(7199)
   * //=> 1
   */
  function secondsToHours(seconds) {
    const hours = seconds / _index.secondsInHour;
    return Math.trunc(hours);
  }