sdlxTimeToDateTime function time
Converts an SDL_Time in nanoseconds since the epoch to a calendar time in the SDL_DateTime format.
\param ticks the SDL_Time to be converted. \param dt the resulting SDL_DateTime. \param localTime the resulting SDL_DateTime will be expressed in local time if true, otherwise it will be in Universal Coordinated Time (UTC). \returns true on success or false on failure; call SDL_GetError() for more information.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL 3.2.0.
extern SDL_DECLSPEC bool SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
See also:
Implementation
SdlxDateTime? sdlxTimeToDateTime(int ticks, {bool localTime = false}) =>
ffi.using((arena) {
final dateTimePointer = arena<SdlDateTime>();
final success = sdlTimeToDateTime(ticks, dateTimePointer, localTime);
if (!success) return null;
return SdlxDateTime.fromPointer(dateTimePointer);
});