/* * Author: Patrick-Christopher Mattulat * Company: Lynar Studios * E-Mail: webmaster@lynarstudios.com * Created: 2023-03-15 * Changed: 2024-05-31 * * */ #include #include #include using ls::std::time::DateParameter; using ls::std::time::DateParameterMapper; using ls::std::time::PosixClock; using ls::std::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; }