SDL_DateTimeToTime(3)
π SDL_DateTimeToTime(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're talking about SDL_DateTimeToTime β the lil glow-up potion that takes a calendar time and turns it into an SDL_Time, measured in nanoseconds since the epoch. yes, nanoseconds. she's precise like that. β¨
β¨ NAME β¨
SDL_DateTimeToTime β converts a calendar time to an SDL_Time in nanoseconds since the epoch. π°οΈπ
π SYNOPSIS π
#include <SDL3/SDL_time.h>
bool SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks);
π¦ DESCRIPTION π¦
so like, here's the tea: this function takes your cute lil SDL_DateTime and hands you back an SDL_Time. that's it. that's the whole job. no cap.
but wait β important detail alert π¨ β it completely ignores the day_of_week member of the SDL_DateTime struct. like, doesn't even look at it. so if you never set it, that's totally fine, it can stay unset, she does not care. live your truth, leave day_of_week blank. π
πΈ FUNCTION PARAMETERS πΈ
dtβ the sourceSDL_DateTime. your input, your calendar moment, the origin story. πticksβ the resultingSDL_Time. this is where the converted value lands. the glow-up destination. β¨
π₯ RETURN VALUE π₯
returns true on success, or false on failure. and if it's a fail? call SDL_GetError() for more info, because she will absolutely tell you what went wrong. no guessing games. π
π§ THREAD SAFETY π§
it is safe to call this function from any thread. every thread. all the threads. go wild, bestie, no locks needed, she's built different. π
β AVAILABILITY β
this function has been available since SDL 3.2.0. iconic behavior, honestly. π«Ά
ngl, if you're out here doing time math in nanoseconds, you're giving main character energy. go off. π
Simple Directmedia Layer πΈ SDL 3.4.18 πΈ SDL_DateTimeToTime(3)
and that's the whole page, bestie β mwah, slay, periodt, catch you in the next manpage πππ¦
π¦ 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