Skip to content

Commit 443a8ef

Browse files
committed
Deprecate fmt::localtime
1 parent 3607e92 commit 443a8ef

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

include/fmt/chrono.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ inline auto localtime(std::time_t time) -> std::tm {
574574
#if FMT_USE_LOCAL_TIME
575575
template <typename Duration,
576576
FMT_ENABLE_IF(detail::has_current_zone<Duration>())>
577-
inline auto localtime(std::chrono::local_time<Duration> time) -> std::tm {
577+
FMT_DEPRECATED inline auto localtime(std::chrono::local_time<Duration> time) -> std::tm {
578578
using namespace std::chrono;
579579
using namespace fmt_detail;
580580
return localtime(detail::to_time_t(current_zone()->to_sys<Duration>(time)));

test/chrono-test.cc

-6
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,6 @@ TEST(chrono_test, system_clock_time_point) {
352352

353353
#if FMT_USE_LOCAL_TIME
354354

355-
TEST(chrono_test, localtime) {
356-
auto t = std::time(nullptr);
357-
auto tm = *std::localtime(&t);
358-
EXPECT_TRUE(equal(tm, fmt::localtime(t)));
359-
}
360-
361355
template <typename Duration>
362356
auto strftime_full_local(std::chrono::local_time<Duration> tp) -> std::string {
363357
auto t = std::chrono::system_clock::to_time_t(

0 commit comments

Comments
 (0)