# getDayOfYear

Industry: Core

## Signature

```ts
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.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | ISO PlainDate string |

## Returns

1-366, or null on invalid input

## Examples

```ts
import { getDayOfYear } from "@northguild/gmt/plain/calculate";

getDayOfYear("2024-01-01") // 1
```

## Source

[plain/calculate/getDayOfYear.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/plain/calculate/getDayOfYear.ts)
