diff --git a/cpp/src/arrow/util/value_parsing_test.cc b/cpp/src/arrow/util/value_parsing_test.cc index 7cd1ab1e25c31..9b6ddfbb19023 100644 --- a/cpp/src/arrow/util/value_parsing_test.cc +++ b/cpp/src/arrow/util/value_parsing_test.cc @@ -838,12 +838,26 @@ TEST(TimestampParser, StrptimeZoneOffset) { std::string format = "%Y-%d-%m %H:%M:%S%z"; auto parser = TimestampParser::MakeStrptime(format); + std::vector values = { + "2018-01-01 00:00:00+0000", + "2018-01-01 00:00:00+0100", +#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) +# if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 28) + "2018-01-01 00:00:00-0117", +# else + // glibc < 2.28 doesn't support "-0117" timezone offset. + // See also: https://github.com/apache/arrow/issues/43808 +# endif +#else + "2018-01-01 00:00:00-0117", +#endif + "2018-01-01 00:00:00+0130" + }; + // N.B. GNU %z supports ISO8601 format while BSD %z supports only // +HHMM or -HHMM and POSIX doesn't appear to define %z at all for (auto unit : TimeUnit::values()) { - for (const std::string value : - {"2018-01-01 00:00:00+0000", "2018-01-01 00:00:00+0100", - "2018-01-01 00:00:00+0130", "2018-01-01 00:00:00-0117"}) { + for (const std::string& value : values) { SCOPED_TRACE(value); int64_t converted = 0; int64_t expected = 0;