diff --git a/src/unit_test/parser/type/datetime/date_type.cpp b/src/unit_test/parser/type/datetime/date_type.cpp index fc21f5bd68..aca8ff617a 100644 --- a/src/unit_test/parser/type/datetime/date_type.cpp +++ b/src/unit_test/parser/type/datetime/date_type.cpp @@ -13,6 +13,7 @@ // limitations under the License. #include "gtest/gtest.h" +#include import base_test; import infinity_exception; @@ -95,13 +96,9 @@ TEST_F(DateTypeTest, TestEqStdChronoBackward) { DateT date; date.FromString("2020-01-31"); - tm tmdate = {}; - tmdate.tm_year = 2020 - 1900; - tmdate.tm_mon = 1 - 1; - tmdate.tm_mday = 31; - time_t time_c = mktime(&tmdate); - system_clock::time_point tp = system_clock::from_time_t(time_c); - sys_days sysdays = ceil(tp); + + year_month_day ymd = 2020y/January/31d; + sys_days sysdays = sys_days{ymd}; for(i32 i = 0; i < 30000; i++) { year_month_day ymd = year_month_day(sysdays); diff --git a/src/unit_test/parser/type/datetime/date_type_std.cpp b/src/unit_test/parser/type/datetime/date_type_std.cpp index 119151d350..06e3a6f66f 100644 --- a/src/unit_test/parser/type/datetime/date_type_std.cpp +++ b/src/unit_test/parser/type/datetime/date_type_std.cpp @@ -1,4 +1,3 @@ -#include "type/datetime/interval_type.h" #include "gtest/gtest.h" import base_test;