getYear
Commons
stable
Returns the full four-digit year of a native Date object. A thin, named wrapper around Date.prototype.getFullYear() that keeps date utility code readable.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- daterequiredDate
- A native JavaScript Date instance.
API
Return value
The value returned by this util.
- The full year as an integer (e.g. 2024).
Usage
Examples
Ready-to-paste usage snippets.
Extract the year from a Date