TimeConstants.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**
  2. * Constants for time conversions like those done by {@link JulianDate}.
  3. *
  4. * @namespace TimeConstants
  5. *
  6. * @see JulianDate
  7. *
  8. * @private
  9. */
  10. const TimeConstants = {
  11. /**
  12. * The number of seconds in one millisecond: <code>0.001</code>
  13. * @type {number}
  14. * @constant
  15. */
  16. SECONDS_PER_MILLISECOND: 0.001,
  17. /**
  18. * The number of seconds in one minute: <code>60</code>.
  19. * @type {number}
  20. * @constant
  21. */
  22. SECONDS_PER_MINUTE: 60.0,
  23. /**
  24. * The number of minutes in one hour: <code>60</code>.
  25. * @type {number}
  26. * @constant
  27. */
  28. MINUTES_PER_HOUR: 60.0,
  29. /**
  30. * The number of hours in one day: <code>24</code>.
  31. * @type {number}
  32. * @constant
  33. */
  34. HOURS_PER_DAY: 24.0,
  35. /**
  36. * The number of seconds in one hour: <code>3600</code>.
  37. * @type {number}
  38. * @constant
  39. */
  40. SECONDS_PER_HOUR: 3600.0,
  41. /**
  42. * The number of minutes in one day: <code>1440</code>.
  43. * @type {number}
  44. * @constant
  45. */
  46. MINUTES_PER_DAY: 1440.0,
  47. /**
  48. * The number of seconds in one day, ignoring leap seconds: <code>86400</code>.
  49. * @type {number}
  50. * @constant
  51. */
  52. SECONDS_PER_DAY: 86400.0,
  53. /**
  54. * The number of days in one Julian century: <code>36525</code>.
  55. * @type {number}
  56. * @constant
  57. */
  58. DAYS_PER_JULIAN_CENTURY: 36525.0,
  59. /**
  60. * One trillionth of a second.
  61. * @type {number}
  62. * @constant
  63. */
  64. PICOSECOND: 0.000000001,
  65. /**
  66. * The number of days to subtract from a Julian date to determine the
  67. * modified Julian date, which gives the number of days since midnight
  68. * on November 17, 1858.
  69. * @type {number}
  70. * @constant
  71. */
  72. MODIFIED_JULIAN_DATE_DIFFERENCE: 2400000.5,
  73. };
  74. export default Object.freeze(TimeConstants);