---
name: "SDL_GetDaysInMonth"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_GetDaysInMonth"
---

# SDL\_GetDaysInMonth(3)

Get the number of days in a month for a given year.

## NAME

SDL\_GetDaysInMonth - Get the number of days in a month for a given year.

## HEADER FILE

Defined in SDL3/SDL\_time.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**int SDL\_GetDaysInMonth(int year, int month);**

## FUNCTION PARAMETERS

- *year*

  the year.

- *month*

  the month \[1-12\].

## RETURN VALUE

Returns the number of days in the requested month or -1 on failure; call  **SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.
