SDL_systime.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #include "SDL_internal.h"
  19. #ifdef SDL_TIME_PS2
  20. #include "../SDL_time_c.h"
  21. // PS2 epoch is Jan 1 2000 JST (UTC +9)
  22. #define UNIX_EPOCH_OFFSET_SEC 946717200
  23. // TODO: Implement this...
  24. void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
  25. {
  26. }
  27. bool SDL_GetCurrentTime(SDL_Time *ticks)
  28. {
  29. CHECK_PARAM(!ticks) {
  30. return SDL_InvalidParamError("ticks");
  31. }
  32. *ticks = 0;
  33. return true;
  34. }
  35. bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
  36. {
  37. CHECK_PARAM(!dt) {
  38. return SDL_InvalidParamError("dt");
  39. }
  40. // FIXME: Need implementation
  41. dt->year = 1970;
  42. dt->month = 1;
  43. dt->day = 1;
  44. dt->hour = 0;
  45. dt->minute = 0;
  46. dt->second = 0;
  47. dt->nanosecond = 0;
  48. dt->day_of_week = 4;
  49. dt->utc_offset = 0;
  50. return true;
  51. }
  52. #endif // SDL_TIME_PS2