diff --git a/velox/functions/lib/DateTimeFormatter.cpp b/velox/functions/lib/DateTimeFormatter.cpp index 598146f28812..0dfd3f652aa1 100644 --- a/velox/functions/lib/DateTimeFormatter.cpp +++ b/velox/functions/lib/DateTimeFormatter.cpp @@ -1532,10 +1532,10 @@ int32_t DateTimeFormatter::format( } case DateTimeFormatSpecifier::WEEK_OF_MONTH: { result += padContent( - ceil( + unsigned(ceil( (7 + static_cast(calDate.day()) - weekday.c_encoding() - 1) / - 7.0), + 7.0)), '0', token.pattern.minRepresentDigits, maxResultEnd,