mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-29 18:27:40 +02:00
Improve chrono formatting
This commit is contained in:
@ -16,6 +16,7 @@
|
||||
|
||||
using fmt::runtime;
|
||||
using fmt::sys_time;
|
||||
using fmt::sys_time;
|
||||
using testing::Contains;
|
||||
|
||||
#if defined(__MINGW32__) && !defined(_UCRT)
|
||||
@ -238,8 +239,6 @@ TEST(chrono_test, format_to_empty_container) {
|
||||
EXPECT_EQ(s, "42");
|
||||
}
|
||||
|
||||
TEST(chrono_test, empty_result) { EXPECT_EQ(fmt::format("{}", std::tm()), ""); }
|
||||
|
||||
TEST(chrono_test, gmtime) {
|
||||
auto t = std::time(nullptr);
|
||||
auto expected = *std::gmtime(&t);
|
||||
@ -337,6 +336,11 @@ TEST(chrono_test, local_time) {
|
||||
fmt::format_error, "no timezone");
|
||||
}
|
||||
|
||||
TEST(chrono_test, tm) {
|
||||
auto time = fmt::gmtime(290088000);
|
||||
test_time(time);
|
||||
}
|
||||
|
||||
TEST(chrono_test, daylight_savings_time_end) {
|
||||
// 2024-10-27 03:05 as the number of seconds since epoch in Europe/Kyiv time.
|
||||
// It is slightly after the DST end and passing it to to_sys will result in
|
||||
|
Reference in New Issue
Block a user