WindowsClock.cpp 720 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-04-01
  6. * Changed: 2023-04-01
  7. *
  8. * */
  9. #include <ls-std/time/common/DateParameterMapper.hpp>
  10. #include <ls-std/time/system-time/WindowsClock.hpp>
  11. #include <windows.h>
  12. using ls::std::time::DateParameter;
  13. using ls::std::time::DateParameterMapper;
  14. using ls::std::time::WindowsClock;
  15. WindowsClock::WindowsClock() = default;
  16. WindowsClock::~WindowsClock() noexcept = default;
  17. bool WindowsClock::setTime(const DateParameter &_dateParameter)
  18. {
  19. SYSTEMTIME systemTime = DateParameterMapper::toWindowsSystemTime(_dateParameter);
  20. return SetLocalTime(&systemTime);
  21. }