SDL_GETDATETIMELOCALEPREFERENCES(3)

✨ SDL_GetDateTimeLocalePreferences ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_GetDateTimeLocalePreferences πŸŽ€


πŸ’– NAME πŸ’–

SDL_GetDateTimeLocalePreferences β€” gets the current preferred date and time format for the system locale. literally just asking the system "hey girl, how do you like your dates and times looking?" πŸ—“οΈβœ¨


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_time.h>

bool SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like… this might be a "slow" call that has to go query the operating system, okay? it's giving "she needs a minute to check her notes" πŸ’…. so the move is to ask for this once and then save the results, no cap.

but β€” and this is the plot twist β€” the preferred formats can change, usually because the user went and changed a system preference outside of your program πŸ™ˆ. so don't be out here assuming it's frozen forever, bestie.


🌈 FUNCTION PARAMETERS 🌈

  • dateFormat β€” a pointer to the SDL_DateFormat to hold the returned date format. may be NULL. (yes, she's optional, she's low maintenance 🫢)
  • timeFormat β€” a pointer to the SDL_TimeFormat to hold the returned time format. may be NULL. (also optional, also iconic πŸ‘‘)

⭐ RETURN VALUE ⭐

returns true on success or false on failure πŸ’€. and if it fails? call SDL_GetError() for more information β€” she will absolutely tell you what went wrong, fr fr.


πŸ”₯ THREAD SAFETY πŸ”₯

this function is not thread safe. so pls do not be passing her around between threads like a group chat screenshot, she cannot handle that energy 😭


πŸ’œ AVAILABILITY πŸ’œ

this function is available since SDL 3.2.0. periodt. πŸ’…


ngl if you're calling this in a loop every frame you're doing too much, bestie β€” grab it once and stash it πŸ“

and that's the whole page, you ate that πŸŽ€βœ¨

signing off from the Simple Directmedia Layer girlies β€” this is the SDL 3.4.18 era, manual page energy only, mwah πŸ’‹πŸ¦‹πŸ’–

πŸ“¦ where this page comes from