Return to Snippet

Revision: 72012
at April 12, 2017 13:47 by sankarwaits

Initial Code
  SYSDATETIME() AS curdatetime,
  DATENAME(TZoffset, SYSDATETIMEOFFSET()) AS curtzoffsetstr,
  DATEPART(TZoffset, SYSDATETIMEOFFSET()) AS curtzoffsetint;

  DECLARE @tzname AS sysname;

EXEC master.dbo.xp_regread
  @tzname OUTPUT;

SELECT @tzname;

Initial URL

Initial Description
The below code has 2 snippets. to find the time difference from the current zone and the other is to find the timezone of the server

Initial Title
SQL To get the Server Timezone.

Initial Tags

Initial Language