index.js 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
  3. Object.defineProperty(exports, "__esModule", {
  4. value: true
  5. });
  6. exports.default = getMilliseconds;
  7. var _index = _interopRequireDefault(require("../toDate/index.js"));
  8. var _index2 = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
  9. /**
  10. * @name getMilliseconds
  11. * @category Millisecond Helpers
  12. * @summary Get the milliseconds of the given date.
  13. *
  14. * @description
  15. * Get the milliseconds of the given date.
  16. *
  17. * @param {Date|Number} date - the given date
  18. * @returns {Number} the milliseconds
  19. * @throws {TypeError} 1 argument required
  20. *
  21. * @example
  22. * // Get the milliseconds of 29 February 2012 11:45:05.123:
  23. * const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))
  24. * //=> 123
  25. */
  26. function getMilliseconds(dirtyDate) {
  27. (0, _index2.default)(1, arguments);
  28. var date = (0, _index.default)(dirtyDate);
  29. var milliseconds = date.getMilliseconds();
  30. return milliseconds;
  31. }
  32. module.exports = exports.default;