Merge pull request #43466 from zzsmdfj/issue_42742_fix_date_diff_wrong_result_build_by_darwin

Fix date_diff() for hour/minute on macOS
This commit is contained in:
Igor Nikonov 2022-11-30 12:23:53 +01:00 committed by GitHub
commit 3869a6c8f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1190,9 +1190,9 @@ struct ToRelativeHourNumImpl
static inline UInt32 execute(UInt32 t, const DateLUTImpl & time_zone)
{
if constexpr (precision_ == ResultPrecision::Extended)
return static_cast<UInt32>(time_zone.toStableRelativeHourNum(static_cast<time_t>(t)));
return static_cast<UInt32>(time_zone.toStableRelativeHourNum(static_cast<DateLUTImpl::Time>(t)));
else
return static_cast<UInt32>(time_zone.toRelativeHourNum(static_cast<time_t>(t)));
return static_cast<UInt32>(time_zone.toRelativeHourNum(static_cast<DateLUTImpl::Time>(t)));
}
static inline auto execute(Int32 d, const DateLUTImpl & time_zone)
{
@ -1226,7 +1226,7 @@ struct ToRelativeMinuteNumImpl
}
static inline UInt32 execute(UInt32 t, const DateLUTImpl & time_zone)
{
return static_cast<UInt32>(time_zone.toRelativeMinuteNum(static_cast<time_t>(t)));
return static_cast<UInt32>(time_zone.toRelativeMinuteNum(static_cast<DateLUTImpl::Time>(t)));
}
static inline auto execute(Int32 d, const DateLUTImpl & time_zone)
{