From 7468a88f2d91146b12ce2f89b8ff772580cdd2b0 Mon Sep 17 00:00:00 2001 From: Dricmoy Bhattacharjee Date: Fri, 13 Nov 2026 11:42:15 -0600 Subject: [PATCH] GH-31315: [C++][Docs] Document strptime %Z behavior Co-Authored-By: Claude Opus 5.5 --- cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc | 7 ++++++- docs/source/cpp/compute.rst | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc b/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc index 74a29081ae86..8a77cb0d55c8 100644 --- a/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc +++ b/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc @@ -1816,7 +1816,12 @@ const FunctionDoc strptime_doc( ("For each string in `strings`, parse it as a timestamp.\n" "The timestamp unit and the expected string pattern must be given\n" "in StrptimeOptions. Null inputs emit null. If a non-null string\n" - "fails parsing, an error is returned by default."), + "fails parsing, an error is returned by default.\n" + "\n" + "The `%Z` directive (time zone name) does not set the result's time\n" + "zone or adjust the parsed time. Depending on the platform, it may\n" + "match any word, only some time zone names, or nothing at all.\n" + "Use `%z` to parse UTC offsets."), {"strings"}, "StrptimeOptions", /*options_required=*/true); const FunctionDoc assume_timezone_doc{ "Convert naive timestamp to timezone-aware timestamp", diff --git a/docs/source/cpp/compute.rst b/docs/source/cpp/compute.rst index a328d7d07655..bfd0c84aa406 100644 --- a/docs/source/cpp/compute.rst +++ b/docs/source/cpp/compute.rst @@ -1433,7 +1433,7 @@ provided by a concrete function :func:`~arrow::compute::Cast`. +-----------------+------------+--------------------+------------------+--------------------------------+-------+ | strftime | Unary | Temporal | String | :struct:`StrftimeOptions` | \(1) | +-----------------+------------+--------------------+------------------+--------------------------------+-------+ -| strptime | Unary | String-like | Timestamp | :struct:`StrptimeOptions` | | +| strptime | Unary | String-like | Timestamp | :struct:`StrptimeOptions` | \(2) | +-----------------+------------+--------------------+------------------+--------------------------------+-------+ The conversions available with ``cast`` are listed below. In all cases, a @@ -1447,6 +1447,11 @@ null input value is converted into a null output value. The character for the decimal point is localized according to the locale. See `detailed formatting documentation`_ for descriptions of other flags. +* \(2) The ``%Z`` directive (time zone name) does not set the result's time + zone or adjust the parsed time. Depending on the platform, it may match any + word, only some time zone names, or nothing at all. Use ``%z`` to parse UTC + offsets. + .. _detailed formatting documentation: https://howardhinnant.github.io/date/date.html#to_stream_formatting **Truth value extraction**