alinaliBQ commented on issue #47504:
URL: https://github.com/apache/arrow/issues/47504#issuecomment-3267858046

   Hi Kou, thanks for confirming that `tzdata` is needed. I think if `UTC` is 
supported then it would help in my case. And maybe there is a simpler way that 
I can suggest without bringing in the time zone database:
   
   Here is the current code
   
https://github.com/apache/arrow/blob/7df396eec4c620ddc4a4db780ea0d5ffa4cf685b/cpp/src/arrow/compute/kernels/scalar_cast_string.cc#L194-L202
   
   Is it possible to change it to look like the following pseudo-code (with my 
imperfect draft syntax):
   ```
   TimestampFormatter<Duration> formatter;
   if ( timezone == "UTC") {
      formatter = { kUtcFormatString };
   } else {
      ARROW_ASSIGN_OR_RAISE(const time_zone* tz, LocateZone(timezone)); 
      ARROW_ASSIGN_OR_RAISE(std::locale locale, GetLocale("C")); 
      formatter = { kFormatString, tz, locale}; 
   }
   ```
   this way since `UTC` covers many use cases, we can omit the `LocateZone` 
call that isn't needed for when timezone is `UTC`. 


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to