SDL_DateTime(3type)
π SDL_DateTime π
okay bestie, so this is a page from the SDL3 DATATYPES corner of the manual, and it's all about SDL_DateTime β literally just a struct that holds a calendar date and time, all broken down into its components. that's it. that's the whole vibe. a lil container for your year/month/day/hour/etc. π
β¨ NAME β¨
SDL_DateTime β a structure holding a calendar date and time broken down into its components. iconic, honestly.
π SYNOPSIS π
#include <SDL3/SDL_time.h>
typedef struct SDL_DateTime
{
int year; /**< Year */
int month; /**< Month [01-12] */
int day; /**< Day of the month [01-31] */
int hour; /**< Hour [0-23] */
int minute; /**< Minute [0-59] */
int second; /**< Seconds [0-60] */
int nanosecond; /**< Nanoseconds [0-999999999] */
int day_of_week; /**< Day of the week [0-6] (0 being Sunday) */
int utc_offset; /**< Seconds east of UTC */
} SDL_DateTime;
so every single field is an int, no cap. let's do a lil vibe check on each one π
int year;β the year. just. the year. no range notes, no drama. she's simple, she's clean.int month;β the month, and it lives in the range[01-12]. one-indexed besties, january is1. πint day;β day of the month, range[01-31].int hour;β the hour, range[0-23]. 24-hour clock only, we don't do am/pm around here.int minute;β the minute, range[0-59].int second;β the seconds, range[0-60]. yes bestie, 60 β that range is giving leap-second energy, it's not a typo, that's what the manual says. πint nanosecond;β nanoseconds, range[0-999999999]. sub-second precision, we're fancy. β¨int day_of_week;β the day of the week, range[0-6], with0being Sunday. so sunday is0, monday is1, and so on down the line.int utc_offset;β seconds east of UTC. that's your timezone offset, measured in seconds, and it's east-positive.
π¦ AVAILABILITY π¦
this struct has been available since SDL 3.2.0. so if you're on anything older, sorry babe, she's not there yet. π
reminder bestie: those ranges are the documented ones, so keep your values inside them and don't be out here writing month = 13 and expecting the universe to fix it for you. π«Ά
and that's the whole page, no notes, we ate. π
this lil datatype page comes to you from Simple Directmedia Layer, SDL 3.4.18, filed under SDL_DateTime(3type) β mwah, slay, bye bestie ππ§
π¦ 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