adding a default format for std::chrono::time_point<std::chrono::syst… (#2345)

This commit is contained in:
sunmy2019 authored and GitHub committed 2021-06-11 10:52:39 -07:00
1 parent 55010a9d3a
commit f28cf3302d
3 files changed
+26

No files matched your search

+1
View File
@@ -99,6 +99,7 @@ template <typename TimePoint> auto strftime(TimePoint tp) -> std::string {
TEST(chrono_test, time_point) {
auto t1 = std::chrono::system_clock::now();
EXPECT_EQ(strftime(t1), fmt::format("{:%Y-%m-%d %H:%M:%S}", t1));
EXPECT_EQ(strftime(t1), fmt::format("{}", t1));
using time_point =
std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>;
auto t2 = time_point(std::chrono::seconds(42));