Skip to content

getUnixYear

  • The core functions, which every industry uses.
getUnixYear(): string

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.
  • 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.

current year string (zero-padded to 4 digits)

import { getUnixYear } from "@northguild/gmt/unix/get";
getUnixYear() // "2024"
output 

unix/get/getUnixYear.ts

Accessibility
© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.