SDL 3.0
|
#include <SDL3/SDL_error.h>
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_begin_code.h>
#include <SDL3/SDL_close_code.h>
Go to the source code of this file.
Data Structures | |
struct | SDL_DateTime |
Enumerations | |
enum | SDL_DateFormat { SDL_DATE_FORMAT_YYYYMMDD = 0 , SDL_DATE_FORMAT_DDMMYYYY = 1 , SDL_DATE_FORMAT_MMDDYYYY = 2 } |
enum | SDL_TimeFormat { SDL_TIME_FORMAT_24HR = 0 , SDL_TIME_FORMAT_12HR = 1 } |
Functions | |
SDL_bool | SDL_GetDateTimeLocalePreferences (SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat) |
SDL_bool | SDL_GetCurrentTime (SDL_Time *ticks) |
SDL_bool | SDL_TimeToDateTime (SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime) |
SDL_bool | SDL_DateTimeToTime (const SDL_DateTime *dt, SDL_Time *ticks) |
void | SDL_TimeToWindows (SDL_Time ticks, Uint32 *dwLowDateTime, Uint32 *dwHighDateTime) |
SDL_Time | SDL_TimeFromWindows (Uint32 dwLowDateTime, Uint32 dwHighDateTime) |
int | SDL_GetDaysInMonth (int year, int month) |
int | SDL_GetDayOfYear (int year, int month, int day) |
int | SDL_GetDayOfWeek (int year, int month, int day) |
enum SDL_DateFormat |
The preferred date format of the current system locale.
Enumerator | |
---|---|
SDL_DATE_FORMAT_YYYYMMDD | Year/Month/Day |
SDL_DATE_FORMAT_DDMMYYYY | Day/Month/Year |
SDL_DATE_FORMAT_MMDDYYYY | Month/Day/Year |
Definition at line 66 of file SDL_time.h.
enum SDL_TimeFormat |
The preferred time format of the current system locale.
Enumerator | |
---|---|
SDL_TIME_FORMAT_24HR | 24 hour time |
SDL_TIME_FORMAT_12HR | 12 hour time |
Definition at line 80 of file SDL_time.h.
|
extern |
Converts a calendar time to an SDL_Time in nanoseconds since the epoch.
This function ignores the day_of_week member of the SDL_DateTime struct, so it may remain unset.
dt | the source SDL_DateTime. |
ticks | the resulting SDL_Time. |
Gets the current value of the system realtime clock in nanoseconds since Jan 1, 1970 in Universal Coordinated Time (UTC).
ticks | the SDL_Time to hold the returned tick count. |
|
extern |
Gets the current preferred date and time format for the system locale.
This might be a "slow" call that has to query the operating system. It's best to ask for this once and save the results. However, the preferred formats can change, usually because the user has changed a system preference outside of your program.
dateFormat | a pointer to the SDL_DateFormat to hold the returned date format, may be NULL. |
timeFormat | a pointer to the SDL_TimeFormat to hold the returned time format, may be NULL. |
|
extern |
Get the day of week for a calendar date.
year | the year component of the date. |
month | the month component of the date. |
day | the day component of the date. |
|
extern |
Get the day of year for a calendar date.
year | the year component of the date. |
month | the month component of the date. |
day | the day component of the date. |
|
extern |
Get the number of days in a month for a given year.
year | the year. |
month | the month [1-12]. |
Converts a Windows FILETIME (100-nanosecond intervals since January 1, 1601) to an SDL time.
This function takes the two 32-bit values of the FILETIME structure as parameters.
dwLowDateTime | the low portion of the Windows FILETIME value. |
dwHighDateTime | the high portion of the Windows FILETIME value. |
|
extern |
Converts an SDL_Time in nanoseconds since the epoch to a calendar time in the SDL_DateTime format.
ticks | the SDL_Time to be converted. |
dt | the resulting SDL_DateTime. |
localTime | the resulting SDL_DateTime will be expressed in local time if true, otherwise it will be in Universal Coordinated Time (UTC). |
Converts an SDL time into a Windows FILETIME (100-nanosecond intervals since January 1, 1601).
This function fills in the two 32-bit values of the FILETIME structure.
ticks | the time to convert. |
dwLowDateTime | a pointer filled in with the low portion of the Windows FILETIME value. |
dwHighDateTime | a pointer filled in with the high portion of the Windows FILETIME value. |