Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions cpp/src/arrow/util/value_parsing_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -838,12 +838,25 @@ TEST(TimestampParser, StrptimeZoneOffset) {
std::string format = "%Y-%d-%m %H:%M:%S%z";
auto parser = TimestampParser::MakeStrptime(format);

std::vector<std::string> values = {
"2018-01-01 00:00:00+0000",
"2018-01-01 00:00:00+0100",
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
// glibc < 2.28 doesn't support "-0117" timezone offset.
// See also: https://github.com/apache/arrow/issues/43808
# if ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 28)) || (__GLIBC__ >= 3)
"2018-01-01 00:00:00-0117",
# 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;
Expand Down