GitHub 6248★

Initialize the current date but set time to midnight

JavaScript version

const midnightOfToday = () => new Date(new Date().setHours(0, 0, 0, 0));

TypeScript version

const midnightOfToday = (): Date => new Date(new Date().setHours(0, 0, 0, 0));
Follow me on and to get more useful contents.