diff --git a/src/Common/DateLUTImpl.h b/src/Common/DateLUTImpl.h index b40b4d7c65b..551375d1f5c 100644 --- a/src/Common/DateLUTImpl.h +++ b/src/Common/DateLUTImpl.h @@ -10,6 +10,8 @@ #include +#define DATE_SECONDS_PER_DAY 86400 /// Number of seconds in a day, 60 * 60 * 24 + #define DATE_LUT_MIN_YEAR 1900 /// 1900 since majority of financial organizations consider 1900 as an initial year. #define DATE_LUT_MAX_YEAR 2299 /// Last supported year (complete) #define DATE_LUT_YEARS (1 + DATE_LUT_MAX_YEAR - DATE_LUT_MIN_YEAR) /// Number of years in lookup table diff --git a/src/Functions/FunctionsConversion.h b/src/Functions/FunctionsConversion.h index 2e21932d0e2..940585d6d57 100644 --- a/src/Functions/FunctionsConversion.h +++ b/src/Functions/FunctionsConversion.h @@ -300,7 +300,7 @@ struct ConvertImpl if constexpr (std::is_same_v && std::is_same_v) vec_to[i] = static_cast(static_cast(vec_from[i])); else if constexpr (std::is_same_v && (std::is_same_v || std::is_same_v)) - vec_to[i] = static_cast(vec_from[i] * 86400); + vec_to[i] = static_cast(vec_from[i] * DATE_SECONDS_PER_DAY); else vec_to[i] = static_cast(vec_from[i]); }