A clean and nice way to convert datetime from UTC to specific time zone using AT TIME ZONE.
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
SELECT CONVERT(datetime, CONVERT(datetimeoffset, GETDATE()) AT TIME ZONE 'E. Australia Standard Time'); |
This way can take into account DST too.