I have to convert UTC dates for some reports. We are using SQL Server 2016 and all my report queries are SPs, so I was able to do this:
SELECT MyDateTime AT TIME ZONE 'Pacific Standard Time' AS 'MyLocalDateTime'
This returns the expected value, but I have not been able to determine if this will still work during daylight savings time.
By querying the time zone info DMV:
select * from sys.time_zone_info
I see there is a column for 'Is DST', so I am assuming the server is tracking that. So can I safely assume sql server will adjust the time as needed during DST?
'Pacific Daylight Time'
?