Add back legacy time_point interface
This commit is contained in:
parent
cc077a5e3b
commit
15ecddc513
@ -477,11 +477,14 @@ inline std::tm localtime(std::time_t time) {
|
|||||||
return lt.tm_;
|
return lt.tm_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline std::tm localtime(std::chrono::system_clock::time_point time_point) {
|
||||||
|
return localtime(std::chrono::system_clock::to_time_t(time_point));
|
||||||
|
}
|
||||||
|
|
||||||
#if FMT_USE_LOCAL_TIME
|
#if FMT_USE_LOCAL_TIME
|
||||||
template <typename Duration>
|
template <typename Duration>
|
||||||
inline auto localtime(std::chrono::local_time<Duration> time) -> std::tm {
|
inline auto localtime(std::chrono::local_time<Duration> time) -> std::tm {
|
||||||
return localtime(std::chrono::system_clock::to_time_t(
|
return localtime(std::chrono::current_zone()->to_sys(time));
|
||||||
std::chrono::current_zone()->to_sys(time)));
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user