getSeconds.cjs 535 B

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