getUtcYear
Signature
Section titled “Signature”getUtcYear(): stringReturn the current year from UTC as a zero-padded string.
- Uses Temporal.Now.instant() converted to UTC zoned date time.
- Returns zero-padded string to 4 digits.
- A year outside 0000–9999 is written with a sign and six digits (
+010000,-000005), as Temporal writes it at the head of a date.
Returns
Section titled “Returns”current year string (zero-padded to 4 digits)
Examples
Section titled “Examples”import { getUtcYear } from "@northguild/gmt/utc/get";
getUtcYear() // "2024"