MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / getUtcMidnight

Function getUtcMidnight

api/src/daily-coding-challenge/utils/helpers.ts:16–20  ·  view source on GitHub ↗
(date: Date)

Source from the content-addressed store, hash-verified

14 * @returns UTC midnight of the given date.
15 */
16export function getUtcMidnight(date: Date): Date {
17 return new Date(
18 Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())
19 );
20}
21
22/**
23 * Parses a date string in the format "YYYY-MM-DD" and returns a Date object set to UTC midnight.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected