Fix year formatter

This commit is contained in:
Vladislav Shchapov
2021-10-16 15:03:57 -07:00
committed by Victor Zverovich
parent 79c00ad8f2
commit 4707373d33
2 changed files with 15 additions and 4 deletions
+5
View File
@@ -60,6 +60,11 @@ TEST(chrono_test, format_tm) {
EXPECT_EQ(fmt::format("{:%F}", tm), "2016-04-25");
EXPECT_EQ(fmt::format("{:%T}", tm), "11:22:33");
// Short year
tm.tm_year = 999 - 1900;
EXPECT_EQ(fmt::format("{:%Y}", tm), "0999");
EXPECT_EQ(fmt::format("{:%G}", tm), "0998");
// for week on the year
// https://www.cl.cam.ac.uk/~mgk25/iso-time.html
std::vector<std::string> str_tm_list = {