SDL_GetDayOfWeek(3)

✨ SDL_GetDayOfWeek ✨

okay bestie, welcome to SDL_GetDayOfWeek(3) β€” it's a lil function from the SDL3 FUNCTIONS family and it's here to tell you what day of the week a calendar date lands on. manifesting your schedule era πŸ’…


🌸 NAME 🌸

SDL_GetDayOfWeek β€” Get the day of week for a calendar date. no cap, that's literally the whole job. πŸ—“οΈβœ¨


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_time.h>

int SDL_GetDayOfWeek(int year, int month, int day);

she's giving "small function, big purpose" energy fr fr πŸ’–


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • year β€” the year component of the date. yes, the whole year. give her the full number. 🌈
  • month β€” the month component of the date. πŸ“
  • day β€” the day component of the date. the actual day-day, not the weekday. okay that wording is confusing but you get it 😭

πŸ’œ RETURN VALUE πŸ’œ

Returns a value between 0 and 6 β€” and 0 is Sunday β€” if the date is valid. πŸŽ‰

If it's not valid, you get -1 on failure. and when that happens? call SDL_GetError() for more information, bestie. she will tell you what went wrong. 🫢

so like... 0 = Sunday, 6 = Saturday. internalize that. it's giving "week starts on Sunday" and honestly? iconic of her.

🧚 THREAD SAFETY 🧚

It is safe to call this function from any thread. go off, thread wherever you want, she does not care. πŸ’šβœ¨


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. so if you're on anything older, bestie... it's not there. πŸ™ˆ


and that's the whole page!! πŸŽ€ made with love by the Simple Directmedia Layer girlies, SDL 3.4.18, and this particular page is dated with the version stamp of that same release. stay hydrated, call your functions, and remember: every day is a valid day if you believe πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from