diff --git a/cpp/src/arrow/compute/kernels/scalar_string_test.cc b/cpp/src/arrow/compute/kernels/scalar_string_test.cc index a98b5937327..4581e6377a7 100644 --- a/cpp/src/arrow/compute/kernels/scalar_string_test.cc +++ b/cpp/src/arrow/compute/kernels/scalar_string_test.cc @@ -1895,11 +1895,17 @@ TYPED_TEST(TestStringKernels, StrptimeZoneOffset) { // N.B. BSD strptime only supports (+/-)HHMM and not the wider range // of values GNU strptime supports. std::string input1 = R"(["5/1/2020 +0100", null, "12/11/1900 -0130"])"; - std::string output1 = + std::string output = R"(["2020-04-30T23:00:00.000000", null, "1900-12-11T01:30:00.000000"])"; - StrptimeOptions options("%m/%d/%Y %z", TimeUnit::MICRO, /*error_is_null=*/true); - this->CheckUnary("strptime", input1, timestamp(TimeUnit::MICRO, "UTC"), output1, - &options); + StrptimeOptions options1("%m/%d/%Y %z", TimeUnit::MICRO, /*error_is_null=*/true); + this->CheckUnary("strptime", input1, timestamp(TimeUnit::MICRO, "UTC"), output, + &options1); + + // format without whitespace before %z (GH-35448) + std::string input2 = R"(["2020-05-01T00:00+0100", null, "1900-12-11T00:00-0130"])"; + StrptimeOptions options2("%Y-%m-%dT%H:%M%z", TimeUnit::MICRO, /*error_is_null=*/true); + this->CheckUnary("strptime", input2, timestamp(TimeUnit::MICRO, "UTC"), output, + &options2); } TYPED_TEST(TestStringKernels, StrptimeDoesNotProvideDefaultOptions) { diff --git a/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc b/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc index 3addaf68630..a88ce389360 100644 --- a/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc +++ b/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc @@ -1237,7 +1237,6 @@ const std::string GetZone(const std::string& format) { zone = "UTC"; break; } - cur++; } else { count = 0; }