startOfYear
Commons
stable
Return a new Date set to January 1st of the same year at midnight. The original date is not mutated.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- daterequisDate
- The reference date. Only the year is preserved; month is 0 (January), day is 1, time is 00:00:00.
API
Valeur de retour
La valeur retournée par cet util.
- A new Date at 2024-01-01T00:00:00 (or the equivalent year).
Usage
Exemples
Extraits de code prêts à coller.
Get the first day of the year