getMilliseconds.cjs 592 B

123456789101112131415161718192021222324
  1. "use strict";
  2. exports.getMilliseconds = getMilliseconds;
  3. var _index = require("./toDate.cjs");
  4. /**
  5. * @name getMilliseconds
  6. * @category Millisecond Helpers
  7. * @summary Get the milliseconds of the given date.
  8. *
  9. * @description
  10. * Get the milliseconds of the given date.
  11. *
  12. * @param date - The given date
  13. *
  14. * @returns The milliseconds
  15. *
  16. * @example
  17. * // Get the milliseconds of 29 February 2012 11:45:05.123:
  18. * const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))
  19. * //=> 123
  20. */
  21. function getMilliseconds(date) {
  22. return (0, _index.toDate)(date).getMilliseconds();
  23. }