-
Notifications
You must be signed in to change notification settings - Fork 924
Timezone Aware Timestamp Parsing #3794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Makes sense to me @waitingkuo what do you think? |
Am I correct this is an improvement to the API, and the semantics of interpreting a timestamp without an offset is still to interpret as UTC? |
This does not alter the current behaviour, however, #1936 tracks using this functionality to interpret such timestamps with respect to the datatype's timezone, if any |
Proposed implementation in #3795 |
* Timezone aware timestamp parsing (#3794) * Add further test * Update arrow-cast/src/parse.rs Co-authored-by: Andrew Lamb <[email protected]> --------- Co-authored-by: Andrew Lamb <[email protected]>
|
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
string_to_timestamp_nanos
contains logic to parse timestamp-like string to nanoseconds since UTC epoch.The semantics for this are well defined for timestamps including a timezone, e.g.
1997-01-31 09:26:56.123Z
or1997-01-31T09:26:56.123-05:00
. However, the semantics get confused for timestamps of the form1997-01-31T09:26:56.123
As pointed out by @MachaelLee on #3787 prior to #2814 timestamp string without a timezone would be interpreted as being in the system's local timezone, and this continues to be what the function docs state happens. This was changed in #2814 by @waitingkuo to instead be parsed in the UTC timezone.
There are at least three "correct" behaviours when parsing strings without an embedded timezone
1997-01-31T09:26:56.123
depending on the contextLocal
timezone and convert back to UTC what it used to doDescribe the solution you'd like
Provide a function with the signature
This could then be used with Local, Utc, or Tz as appropriate.
We could then update
string_to_timestamp_nanos
to be something likeAnd possibly deprecate it as it has rather confusing semantics
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: