| 1234567891011121314151617181920212223242526272829 |
- /*
- * Author: Patrick-Christopher Mattulat
- * Co-Author: Claude Sonnet 4.6 (LLM)
- * Company: Lynar Studios
- * E-Mail: webmaster@lynarstudios.com
- * Created: 2023-03-15
- * Changed: 2026-06-23
- *
- * */
- #include <ctime>
- #include <ls-std/time/common/DateParameterMapper.hpp>
- #include <ls-std/time/system-time/PosixClock.hpp>
- using ls::standard::time::DateParameter;
- using ls::standard::time::DateParameterMapper;
- using ls::standard::time::PosixClock;
- using ls::standard::time::type::UnixTimestamp;
- PosixClock::PosixClock() = default;
- PosixClock::~PosixClock() noexcept = default;
- bool PosixClock::setTime(const DateParameter &_dateParameter)
- {
- const UnixTimestamp timestamp = DateParameterMapper::toUnixTimestamp(_dateParameter);
- const timespec timespec{timestamp, 0};
- return clock_settime(CLOCK_REALTIME, ×pec) == 0;
- }
|