-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Implicit cast from datetimeoffset to other date/time datatypes. (#…
…1927) Due to implicit cast from datetimeoffset to datetime we are getting wrong output --- AT TIME ZONE returns datetimeoffset DECLARE @lvDateEastern DATETIME, @lvDateUTC DATETIME SET @lvDateUTC = '2021-01-01' SET @lvDateEastern = @lvDateUTC AT TIME ZONE 'UTC' AT TIME ZONE 'US Eastern Standard Time' SELECT @lvDateUTC, @lvDateEastern @lvDateUTC @lvDateEastern ----------------------- ----------------------- 2021-01-01 00:00:00.000 2021-01-01 00:00:00.000 Expected ----------------------- ----------------------- 2021-01-01 00:00:00.000 2020-12-31 19:00:00.000 The above same issue is occuring when we are doing implicit cast from datetimeoffset to time,date,smalldatetime,datetime2. Fixed this issue by excluding the timezone offset addition/subtraction to the original timestamp . Issues Resolved : BABEL-986 Signed-off-by: Ashish Prasad <[email protected]>
- Loading branch information
Showing
17 changed files
with
182 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.