Skip to content

getDayOfYear

  • The core functions, which every industry uses.
getDayOfYear(value: string): number | null

Return the ordinal day-of-year (1-based) for value.

  • Jan 1 is 1; Dec 31 is 365 (common year) or 366 (leap year).
  • Returns null on invalid input.
ParameterTypeDescription
valuestringISO PlainDate string

1-366, or null on invalid input

import { getDayOfYear } from "@northguild/gmt/plain/calculate";
getDayOfYear("2024-01-01") // 1
output 

plain/calculate/getDayOfYear.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.