Module time
Available on crate feature
dep_sdl3
only.Expand description
SDL realtime clock and date/time routines.
There are two data types that are used in this category: SDL_Time
, which
represents the nanoseconds since a specific moment (an “epoch”), and
SDL_DateTime
, which breaks time down into human-understandable components:
years, months, days, hours, etc.
Much of the functionality is involved in converting those two types to other useful forms.
Structs§
- SDL_
Date Format - The preferred date format of the current system locale.
- SDL_
Date Time - A structure holding a calendar date and time broken down into its components.
- SDL_
Time Format - The preferred time format of the current system locale.
Constants§
- SDL_
DATE_ FORMAT_ DDMMYYYY - Day/Month/Year
- SDL_
DATE_ FORMAT_ MMDDYYYY - Month/Day/Year
- SDL_
DATE_ FORMAT_ YYYYMMDD - Year/Month/Day
- SDL_
TIME_ FORMAT_ 12HR - 12 hour time
- SDL_
TIME_ FORMAT_ 24HR - 24 hour time
Functions§
- SDL_
Date ⚠Time ToTime - Converts a calendar time to an
SDL_Time
in nanoseconds since the epoch. - SDL_
GetCurrent ⚠Time - Gets the current value of the system realtime clock in nanoseconds since Jan 1, 1970 in Universal Coordinated Time (UTC).
- SDL_
GetDate ⚠Time Locale Preferences - Gets the current preferred date and time format for the system locale.
- SDL_
GetDay ⚠OfWeek - Get the day of week for a calendar date.
- SDL_
GetDay ⚠OfYear - Get the day of year for a calendar date.
- SDL_
GetDays ⚠InMonth - Get the number of days in a month for a given year.
- SDL_
Time ⚠From Windows - Converts a Windows FILETIME (100-nanosecond intervals since January 1, 1601) to an SDL time.
- SDL_
Time ⚠ToDate Time - Converts an
SDL_Time
in nanoseconds since the epoch to a calendar time in theSDL_DateTime
format. - SDL_
Time ⚠ToWindows - Converts an SDL time into a Windows FILETIME (100-nanosecond intervals since January 1, 1601).