# getDaysInMonth

Industry: Core

## Signature

```ts
getDaysInMonth(value: string): number | null
```

Return the number of days in the month containing `value`.

- 28–31 depending on the month; February varies by leap year.
- Returns null on invalid input.

## Parameters

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

## Returns

number of days in the month (28-31), or null on invalid input

## Examples

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

getDaysInMonth("2024-02-15") // 29 (leap year)
```

## Source

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