Skip to content

getDayOfYear

The getDayOfYear() function returns the day of the year (1–366) for a TheDate, taking an optional timezone into account.

Interactive example

Syntax

typescript
function getDayOfYear<
	GenericInput extends TheDate
>(
	input: GenericInput,
	timezone?: Timezone
): number

Parameters

  • input: Target TheDate.
  • timezone: Timezone (optional).

Return value

An integer between 1 and 366.

See also

Sources

Released under the MIT license.