mssql: DATETIMEOFFSET: When transforming to UTC, use ISO 8601 convention #951
+15
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #946
In the previous release we introduced a SQL SERVER improvement where
DATETIMEOFFSET
data is automatically transformed into UTC and returned asPOSIXct
( previously returned as strings containing the offset ). As part of that transformation we usecctz
to transform the specified offset into a timezone and in turn intoUTC
time.As it turns out there are competing (and opposing) conventions for the direction of the offset:
We coded the feature to keep with the
POSIX
convention. However, I think it probably makes sense to convert to using ISO8601 since it is referenced in the Microsoft docs, although the docs don't specifically mention the direction of the offset.The way coded in this patch, we make a clean break and note it in the release notes. Given that this is a breaking change, we could introduce a package option (
odbc.mssql.tz_direction
) or somesuch. I am slightly biased towards going with what's here since we've only had this code in for a few weeks/months, however can be swayed.cc @r2evans