(This is the documentation for SDL3, which is under heavy development and the API is changing! SDL2 is the current stable version!)

SDL_GetDaysInMonth

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

Header File

Defined in <SDL3/SDL_time.h>

Syntax

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, otherwise -1; call SDL_GetError() for more information.

Version

This function is available since SDL 3.0.0.


CategoryAPI, CategoryAPIFunction, CategoryTime