MCPcopy
hub / github.com/date-fns/date-fns / differenceInSeconds

Function differenceInSeconds

pkgs/core/src/differenceInSeconds/index.ts:33–40  ·  view source on GitHub ↗
(
  laterDate: DateArg<Date> & {},
  earlierDate: DateArg<Date> & {},
  options?: DifferenceInSecondsOptions,
)

Source from the content-addressed store, hash-verified

31 * //=> 12
32 */
33export function differenceInSeconds(
34 laterDate: DateArg<Date> & {},
35 earlierDate: DateArg<Date> & {},
36 options?: DifferenceInSecondsOptions,
37): number {
38 const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;
39 return getRoundingMethod(options?.roundingMethod)(diff);
40}

Callers 4

formatDistanceFunction · 0.90
test.tsFile · 0.90
intervalToDurationFunction · 0.90
intlFormatDistanceFunction · 0.90

Calls 2

differenceInMillisecondsFunction · 0.90
getRoundingMethodFunction · 0.90

Tested by

no test coverage detected