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

Function startOfSecond

pkgs/core/src/startOfSecond/index.ts:33–43  ·  view source on GitHub ↗
(
  date: DateArg<DateType>,
  options?: StartOfSecondOptions<ResultDate> | undefined,
)

Source from the content-addressed store, hash-verified

31 * //=> Mon Dec 01 2014 22:15:45.000
32 */
33export function startOfSecond<
34 DateType extends Date,
35 ResultDate extends Date = DateType,
36>(
37 date: DateArg<DateType>,
38 options?: StartOfSecondOptions<ResultDate> | undefined,
39): ResultDate {
40 const date_ = toDate(date, options?.in);
41 date_.setMilliseconds(0);
42 return date_;
43}

Callers 2

test.tsFile · 0.90
isSameSecondFunction · 0.90

Calls 1

toDateFunction · 0.90

Tested by

no test coverage detected