You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing a timestamp (e.g., timestamp("2020-10-20T12:00:00-05:00")), the provided timezone offset is stored but not output by __str__ or __repr__ which are hard coded to output the Z UTC abbreviation.
I think this is just a display issue, as the offset does appear to be used in comparisons. But it can be confusing when playing around in a repl shell. Example:
In [155]: utc = celtypes.TimestampType('2020-10-20T12:00:00Z')
In [156]: not_utc = celtypes.TimestampType('2020-10-20T12:00:00-05:00')
In [157]: utc
Out[157]: TimestampType('2020-10-20T12:00:00Z')
In [158]: not_utc
Out[158]: TimestampType('2020-10-20T12:00:00Z')
In [159]: utc == not_utc
Out[159]: False
In [160]: str(utc) == str(not_utc)
Out[160]: True
The text was updated successfully, but these errors were encountered:
jvolkman
changed the title
TimestampType.__str__ doesn't honor timestamp offset
TimestampType.__str__ doesn't honor timezone offset
May 7, 2021
When parsing a timestamp (e.g.,
timestamp("2020-10-20T12:00:00-05:00")
), the provided timezone offset is stored but not output by__str__
or__repr__
which are hard coded to output theZ
UTC abbreviation.I think this is just a display issue, as the offset does appear to be used in comparisons. But it can be confusing when playing around in a repl shell. Example:
The text was updated successfully, but these errors were encountered: