I am trying to use AT TIME ZONE of SQL Server to get server date time for certain UTC date.
But AT TIME ZONE requires to pass the timezone id of the timezone.
But somehow I am not able to find the way to get timezone id of server timezone in SQL Server in the format this function expects.
There does exist a function CURRENT_TIMEZONE() but it is also not returning the timezone id.
I found this function also CURRENT_TIMEZONE_ID, but I am not able to find it in SQL Server 2019, the description looks like it is for Azure specifically.
So is there any way through which rather than passing the hardcoded timezone id like this, I can use something which will pick the current timezone id of the server
SELECT CONVERT(DATETIME2(0), '2015-03-29T01:01:00', 126)
AT TIME ZONE 'Central European Standard Time';