jorisvandenbossche opened a new issue, #35448:
URL: https://github.com/apache/arrow/issues/35448

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   https://github.com/apache/arrow/pull/11358 refactored the timezone offset 
handling in string parsing (both in read_csv, casting str->timestamp and 
strptime). 
   
   The general rule was that if there is a `%z` in the format string you 
provide to `strptime`, we apply the offset and return a timestamp type with 
tz=UTC. 
   But this seems to work only in certain cases:
   
   ```
   # space before %z -> works
   >>> pc.strptime(["5/1/2020 +0100", None, "12/11/1900 -0130"], 
format="%m/%d/%Y %z", unit='us').type
   TimestampType(timestamp[us, tz=UTC])
   # no space before %z -> doesn't work
   >>> pc.strptime(["5/1/2020+0100", None, "12/11/1900-0130"], 
format="%m/%d/%Y%z", unit='us').type
   TimestampType(timestamp[us])
   ```
   
   
   ### Component(s)
   
   C++


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to