You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "MachaelLee (via GitHub)" <gi...@apache.org> on 2023/03/02 11:40:00 UTC

[GitHub] [arrow-rs] MachaelLee opened a new pull request, #3787: feat: add a function to parse a string without timezone to local timestamp

MachaelLee opened a new pull request, #3787:
URL: https://github.com/apache/arrow-rs/pull/3787

   # Which issue does this PR close?
   
   None
   
   Closes #.
   
   # Rationale for this change
    
   Before  modification with #2814, function `string_to_timestamp_nanos` return a local timestamp when parsing a string without an explicit time zone.
   But after modification with #2814, I found the function `string_to_timestamp_nanos` return a UTC timestamp when parsing a string without an explicit time zone.
   
   
   # What changes are included in this PR?
   
   Add a function `string_to_local_timestamp_nanos` which interprets strings without an explicit time zone as
    timestamps with offsets of the local time on the machine.
   
   For example,`2022-12-30T09:26:56.123` is interpreted as a local timestamp in the timezone of the machine. For example, if the system timezone is set to Asia/Shanghai (UTC+8) the timestamp will be interpreted as though it were
   `2022-12-30T09:26:56.123+08:00` 
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-rs] tustvold commented on pull request #3787: feat: add a function to parse a string without timezone to local timestamp

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #3787:
URL: https://github.com/apache/arrow-rs/pull/3787#issuecomment-1453185931

   string_to_datetime contains all the current logic, including handling strings with an embedded timezone. It will convert them appropriately


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-rs] tustvold closed pull request #3787: feat: add a function to parse a string without timezone to local timestamp

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold closed pull request #3787: feat: add a  function to parse a string without timezone to local timestamp
URL: https://github.com/apache/arrow-rs/pull/3787


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-rs] tustvold commented on pull request #3787: feat: add a function to parse a string without timezone to local timestamp

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #3787:
URL: https://github.com/apache/arrow-rs/pull/3787#issuecomment-1454704126

   Closing as I believe this functionality is provided by #3795. Feel free to reopen if I am mistaken


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-rs] MachaelLee commented on pull request #3787: feat: add a function to parse a string without timezone to local timestamp

Posted by "MachaelLee (via GitHub)" <gi...@apache.org>.
MachaelLee commented on PR #3787:
URL: https://github.com/apache/arrow-rs/pull/3787#issuecomment-1452881512

   > I think you should be able to just provide it with [Local](https://docs.rs/chrono/latest/chrono/offset/struct.Local.html) as the timezone parameter
   
   I have read your issue and PR, and there is a question:
   if I want to parse a string with time zone, what should I do with `string_to_datetime `?
   My precondition is I do not know the format of  timestamp-like string.
   ``


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-rs] tustvold commented on pull request #3787: feat: add a function to parse a string without timezone to local timestamp

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #3787:
URL: https://github.com/apache/arrow-rs/pull/3787#issuecomment-1451905983

   Thank you for this, I would like to take some time to think about this API. I think we might want a way to specify the destination timezone for the function, perhaps adding the ability to pass an `Option<Tz>`. This would not only cover the case of parsing interpreting as the local timezone, but also parsing into a TimestampArray with a non-UTC timezone set which I think is currently handled incorrectly...


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-rs] tustvold commented on pull request #3787: feat: add a function to parse a string without timezone to local timestamp

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #3787:
URL: https://github.com/apache/arrow-rs/pull/3787#issuecomment-1452393368

   I've added an alternative proposal in https://github.com/apache/arrow-rs/pull/3795 PTAL :pray: 
   
   I think you should be able to just provide it with [Local](https://docs.rs/chrono/latest/chrono/offset/struct.Local.html) as the timezone parameter


-- 
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-unsubscribe@arrow.apache.org

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