Set System Time Zone from .NET

There’s another way to do this, which admittedly is a bit of a hack, but works quite well in practice:

public void SetSystemTimeZone(string timeZoneId)
{
    var process = Process.Start(new ProcessStartInfo
    {
        FileName = "tzutil.exe",
        Arguments = "/s \"" + timeZoneId + "\"",
        UseShellExecute = false,
        CreateNoWindow = true
    });

    if (process != null)
    {
        process.WaitForExit();
        TimeZoneInfo.ClearCachedData();
    }
}

Simply call this method and pass the TimeZoneInfo.Id that you wish to set. For example:

SetSystemTimeZone("Eastern Standard Time");

No special privileges are required to run this code, as tzutil.exe already has the appropriate permissions.

Leave a Comment