SDL_GetDaysInMonth(3)

πŸ’– SDL_GetDaysInMonth πŸ’–

okay bestie, so this is a page from the SDL3 functions manual β€” yes, that SDL, the Simple Directmedia Layer girlies πŸ’… β€” and today we're talking about SDL_GetDaysInMonth. it's literally the calendar bestie you call when you need to know how many days are in a month, for a specific year. leap years could NEVER catch you off guard again πŸ¦‹


✨ NAME ✨

SDL_GetDaysInMonth β€” get the number of days in a month for a given year. that's it, that's the whole vibe 🌸


🌈 SYNOPSIS 🌈

#include <SDL3/SDL_time.h>

int SDL_GetDaysInMonth(int year, int month);

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • year β€” the year. yes queen, the actual year, like 2025 energy. πŸ‘‘
  • month β€” the month, and it has to be in the range [1-12]. so like, January is 1, December is 12, and 0 is not a month, bestie, don't do that πŸ™ˆ

πŸ’« RETURN VALUE πŸ’«

it hands you back the number of days in the requested month ✨ or -1 if something went wrong 😭 and if you get that -1, go ahead and call SDL_GetError() for more info β€” she'll tell you what's up fr fr.


🧚 THREAD SAFETY 🧚

it is safe to call this function from any thread. no cap. go off, multithreaded icon πŸ’…


⭐ AVAILABILITY ⭐

this function has been available since SDL 3.2.0. so if you're on something older... girl, upgrade 🫢


lowkey the most wholesome function in the whole time header. no side effects, no drama, just days. periodt. πŸ’–

and that's the whole page, bestie!! πŸŽ€ this little slice of wisdom came to you from Simple Directmedia Layer, SDL 3.4.18, and it's the SDL_GetDaysInMonth(3) page itself. go count some days, you absolute main character πŸŒˆπŸ’œ

πŸ“¦ where this page comes from