Technical Article

Change Time Zone on Server without Logging on to Box

,

Sometimes logging onto a box for a simple change like this is not possible for the business. This allows you to change this directly from T-SQL without having to log on or RDP into the box.

--Check Curent Windows Time Zone
select GETUTCDATE()
--Check Current Local Time Zone
select getdate()

--Change Time Zone to Mountain Time
EXEC XP_CMDSHELL 'RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z (GMT-07:00) Mountain Time'

--Verify Windows Time Zone
select GETUTCDATE()
--Verify Local Time Zone Change
select getdate()

Rate

(1)

You rated this post out of 5. Change rating

Share

Share

Rate

(1)

You rated this post out of 5. Change rating