CREATE PROCEDURE dbo.ConvertDateTime @ADateTime DATETIME, @AFromTimeZone VARCHAR(100), @AToTimeZone VARCHAR(100), @AResultDateTime DATETIME OUTPUT AS
/*
Created by Kent Johansen, december 2024
Convert a datatime from one time zone to another
Example: Convert from Greenland time to UTA
  EXEC ConvertDateTime @Adt, 'Greenland Standard Time', 'UTC'
Time zone names can be retrieved by: SELECT * FROM sys.time_zone_info

*/
SELECT @AResultDateTime = @ADateTime AT TIME ZONE @AFromTimeZone AT TIME ZONE @AToTimeZone