[Base] Added NtSystemClock to_local for quick time conversion to current timezone

- Changed achievement reward time to local time (in UI)
This commit is contained in:
Gliniak
2024-12-26 11:31:37 +01:00
committed by Radosław Gliński
parent c3586bc165
commit bcc3c3172d
2 changed files with 10 additions and 2 deletions

View File

@@ -91,6 +91,14 @@ struct NtSystemClock {
return sys_time{cdp.time_since_epoch()};
}
template <Domain domain_fresh_ = domain_>
static constexpr std::enable_if_t<
domain_fresh_ == Domain::Host,
std::chrono::local_time<std::chrono::system_clock::duration>>
to_local(const time_point& tp) {
return std::chrono::current_zone()->to_local(to_sys(tp));
}
template <Domain domain_fresh_ = domain_>
static constexpr std::enable_if_t<domain_fresh_ == Domain::Host, time_point>
from_sys(const std::chrono::system_clock::time_point& tp) {