getUnixYear
Signature
Section titled “Signature”getUnixYear(): stringimport { getUnixYear } from "@northguild/gmt/unix/get";Return the current year from the Unix timestamp in UTC as a zero-padded string.
- Uses Temporal.Now.instant() converted to UTC zoned date time.
- Returns zero-padded string to 4 digits.
- Returns “” on failure.
Returns
Section titled “Returns”current year string (zero-padded to 4 digits) or “” on failure
Examples
Section titled “Examples”getUnixYear() // "2024"getUnixYear() // "" (on failure)