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 theSDL_DateFormatto hold the returned date format. may beNULL. (yes, she's optional, she's low maintenance π«Ά)timeFormatβ a pointer to theSDL_TimeFormatto hold the returned time format. may beNULL. (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
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms