startOfDay

Commons
stable

Return a new Date set to midnight (00:00:00.000) of the same calendar day. The original date is not mutated.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

date
required
Date
The reference date. Year, month and day are preserved; time fields are set to zero.

API

Return value

The value returned by this util.

A new Date at 00:00:00.000 of the given day.

Usage

Examples

Ready-to-paste usage snippets.

Strip the time part from a datetime

typescript