Tuesday 19 November 2019

Get TimeZone Name of the System in SQL Server


DECLARE @TimeZone VARCHAR(50)

EXEC MASTER.dbo.xp_regread 'HKEY_LOCAL_MACHINE',
       'SYSTEM\CurrentControlSet\Control\TimeZoneInformation',
       'TimeZoneKeyName', @TimeZone OUT

SELECT @TimeZone AS TimeZone


No comments:

Post a Comment