SDL/VisualC/tests
Frank Praznik a6fbf0488c Add time and realtime clock functions
Adds functions to query the system's realtime clock, convert time intervals to/from a calendar date and time in either UTC or the local time, and perform time related calculations.

An SDL_Time type (a time interval represented in nanoseconds), and SDL_DateTime struct (broken down calendar date and time) were added to facilitate this functionality.

Querying the system time results in a value expressed in nanoseconds since the Unix epoch (Jan 1, 1970) in UTC +0000. Conversions to and from the various platform epochs and units are performed when required.

Any direct handling of timezones and DST were intentionally avoided. The offset from UTC is provided when converting from UTC to a local time by calculating the difference between the original UTC and the resulting local time, but no other timezone or DST information is used.

The preferred date formatting and 12/24 hour time for the system locale can be retrieved via global preferences.

Helper functions for obtaining the day of week or day or year for calendar date, and getting the number of days in a month in a given year are provided for convenience. These are simple, but useful for performing various time related calculations.

An automated test for time conversion is included, as is a simple standalone test to display the current system date and time onscreen along with a calendar, the rendering of which demonstrates the use of the utility functions (press up/down to increment or decrement the current month, and keys 1-5 to change the date and time formats).
2024-03-19 10:57:36 -07:00
..
checkkeys Remove SDL_main from VS Solutions in VisualC/ and VisualC-GDK/ 2022-12-15 08:01:01 -08:00
loopwave testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00
testatomic testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00
testautomation Add time and realtime clock functions 2024-03-19 10:57:36 -07:00
testcontroller Renamed testgamepad to testcontroller 2023-07-16 04:32:12 -07:00
testdraw Rename SDL2 tests for SDL3 2023-01-03 11:54:35 -08:00
testfile testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00
testgl Rename SDL2 tests for SDL3 2023-01-03 11:54:35 -08:00
testgles2 Remove SDL_main from VS Solutions in VisualC/ and VisualC-GDK/ 2022-12-15 08:01:01 -08:00
testoverlay Rename SDL2 tests for SDL3 2023-01-03 11:54:35 -08:00
testpen Added testpen to the Visual Studio solution 2023-12-26 09:55:09 -08:00
testplatform testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00
testpower testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00
testrendertarget Remove SDL_main from VS Solutions in VisualC/ and VisualC-GDK/ 2022-12-15 08:01:01 -08:00
testrumble testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00
testscale Remove SDL_main from VS Solutions in VisualC/ and VisualC-GDK/ 2022-12-15 08:01:01 -08:00
testsensor testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00
testshape testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00
testsprite Rename SDL2 tests for SDL3 2023-01-03 11:54:35 -08:00
testsurround testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00
testvulkan Remove SDL_main from VS Solutions in VisualC/ and VisualC-GDK/ 2022-12-15 08:01:01 -08:00
testwm Rename SDL2 tests for SDL3 2023-01-03 11:54:35 -08:00
testyuv testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00