forked from fmtlib/fmt
Deprecate fmt::localtime
This commit is contained in:
@ -574,7 +574,7 @@ inline auto localtime(std::time_t time) -> std::tm {
|
|||||||
#if FMT_USE_LOCAL_TIME
|
#if FMT_USE_LOCAL_TIME
|
||||||
template <typename Duration,
|
template <typename Duration,
|
||||||
FMT_ENABLE_IF(detail::has_current_zone<Duration>())>
|
FMT_ENABLE_IF(detail::has_current_zone<Duration>())>
|
||||||
inline auto localtime(std::chrono::local_time<Duration> time) -> std::tm {
|
FMT_DEPRECATED inline auto localtime(std::chrono::local_time<Duration> time) -> std::tm {
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
using namespace fmt_detail;
|
using namespace fmt_detail;
|
||||||
return localtime(detail::to_time_t(current_zone()->to_sys<Duration>(time)));
|
return localtime(detail::to_time_t(current_zone()->to_sys<Duration>(time)));
|
||||||
|
@ -352,12 +352,6 @@ TEST(chrono_test, system_clock_time_point) {
|
|||||||
|
|
||||||
#if FMT_USE_LOCAL_TIME
|
#if FMT_USE_LOCAL_TIME
|
||||||
|
|
||||||
TEST(chrono_test, localtime) {
|
|
||||||
auto t = std::time(nullptr);
|
|
||||||
auto tm = *std::localtime(&t);
|
|
||||||
EXPECT_TRUE(equal(tm, fmt::localtime(t)));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Duration>
|
template <typename Duration>
|
||||||
auto strftime_full_local(std::chrono::local_time<Duration> tp) -> std::string {
|
auto strftime_full_local(std::chrono::local_time<Duration> tp) -> std::string {
|
||||||
auto t = std::chrono::system_clock::to_time_t(
|
auto t = std::chrono::system_clock::to_time_t(
|
||||||
|
Reference in New Issue
Block a user