diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 7ed4ba21..83987953 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -574,7 +574,7 @@ inline auto localtime(std::time_t time) -> std::tm { #if FMT_USE_LOCAL_TIME template ())> -inline auto localtime(std::chrono::local_time time) -> std::tm { +FMT_DEPRECATED inline auto localtime(std::chrono::local_time time) -> std::tm { using namespace std::chrono; using namespace fmt_detail; return localtime(detail::to_time_t(current_zone()->to_sys(time))); diff --git a/test/chrono-test.cc b/test/chrono-test.cc index 7d3032be..b12f4422 100644 --- a/test/chrono-test.cc +++ b/test/chrono-test.cc @@ -352,12 +352,6 @@ TEST(chrono_test, system_clock_time_point) { #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 auto strftime_full_local(std::chrono::local_time tp) -> std::string { auto t = std::chrono::system_clock::to_time_t(