SDL_DateFormat(3type)

πŸ’– SDL_DateFormat πŸ’–

okay bestie, welcome to the SDL3 DATATYPES corner of the manual, where we talk about SDL_DateFormat β€” literally just the date format that your current system locale is obsessed with. that's it. that's the whole vibe. πŸŽ€

It's giving "what order do the numbers go in" and honestly? iconic.


✨ SYNOPSIS ✨

first things first, you gotta let the compiler know what's up:

#include <SDL3/SDL_time.h>

typedef enum SDL_DateFormat
{
    SDL_DATE_FORMAT_YYYYMMDD = 0, /**< Year/Month/Day */
    SDL_DATE_FORMAT_DDMMYYYY = 1, /**< Day/Month/Year */
    SDL_DATE_FORMAT_MMDDYYYY = 2  /**< Month/Day/Year */
} SDL_DateFormat;

so like, it's an enum, she's a typedef, and she comes with three whole moods. let's break them down πŸ‘‘

  • SDL_DATE_FORMAT_YYYYMMDD = 0 β€” Year/Month/Day. big-endian girlies rise up, the ISO 8601 girlies, the "sortable by default" queens. πŸ’…
  • SDL_DATE_FORMAT_DDMMYYYY = 1 β€” Day/Month/Year. the day comes FIRST, she's eager, she's ready. πŸ¦‹
  • SDL_DATE_FORMAT_MMDDYYYY = 2 β€” Month/Day/Year. month leads the parade, no notes. 🌸

and that's literally the entire enum. three little ints, all besties, all valid.


🌈 AVAILABILITY 🌈

This enum is available since SDL 3.2.0. so if you're on something older, no she's not there, don't go looking, she hasn't been born yet. 😭

πŸ‘€ SEE ALSO πŸ‘€

  • SDL_GetDateTimeLocalePreferences(3) β€” go read her next, she's the one who actually tells you which of these three formats your system picked. the enum is just the vocabulary, that function is the gossip. 🫢

and that's the whole page bestie, you ate it, you understood it, periodt πŸ’–βœ¨

this little datatype page came to you courtesy of Simple Directmedia Layer, version SDL 3.4.18, and she's filed under SDL_DateFormat(3type) β€” mwah, go forth and format your dates correctly, i'm obsessed with you πŸŽ€πŸ’œ

πŸ“¦ where this page comes from