Skip to content

Commit 6d2d1a3

Browse files
committed
Fix deprecation
1 parent 0cb75cb commit 6d2d1a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/infra/chrono.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ template <typename Clock, typename Duration>
125125
std::string to_string(std::chrono::time_point<Clock, Duration> tp)
126126
{
127127
std::time_t time = Clock::to_time_t(tp);
128-
return fmt::format("{:%c}", fmt::localtime(time));
128+
return fmt::format(fmt::runtime("{:%c}"), std::localtime(&time));
129129
}
130130

131131
std::string to_string(local_time_point tp);
@@ -146,7 +146,7 @@ std::string to_string(std::string_view format, std::chrono::time_point<Clock, Du
146146
return fmt::format(fmt::runtime(fmt::format("{{:{}}}", format)), tp);
147147
} else {
148148
std::time_t time = Clock::to_time_t(tp);
149-
return fmt::format(fmt::runtime(fmt::format("{{:{}}}", format)), fmt::localtime(time));
149+
return fmt::format(fmt::runtime(fmt::format("{{:{}}}", format)), std::localtime(&time));
150150
}
151151
}
152152
}

0 commit comments

Comments
 (0)