Changing the timezone on Vista SP1

  • Thread starter Thread starter Marco Shaw [MVP]
  • Start date Start date
M

Marco Shaw [MVP]

I've searched around in the Windows SDK. Is there a .NET class that can
help me to change the timezone setting on a Vista machine?

Marco

MVP: Windows Server - Admin Frameworks
 
Marco said:
I've searched around in the Windows SDK. Is there a .NET class that can
help me to change the timezone setting on a Vista machine?
Short answer: no. In fact, there's no way to change the system time at all
from .NET, barring P/Invoking. It's one of those tasks that's rare and
privileged, so the managed world doesn't expose it. Typically the
functionality should be centralized -- either locally and manually (the
Date and Time applet) or managed from Active Directory and/or deployed
scripts. If individual applications start messing with it, things can get ugly.

You can do it from Win32 with SetTimeZoneInformation(), and of course you
can import and call that from C#, but there's no managed equivalent.
 
Marco Shaw said:
I've searched around in the Windows SDK. Is there a .NET class that can
help me to change the timezone setting on a Vista machine?

Marco

MVP: Windows Server - Admin Frameworks

Marco:

If I understand your question, you wish to change the time zone on your
Vista machine. Easily done--just right click the time in the lower right
corner and a pop-up menu will appear. One of the choices is Adjust
Time/Date. Click on that choice and you will geta screen to make the cahnges
you want.
 
Renegade,

What marco and i are looking for is a way to do this through a script. It
needs to be automated for deployment purposes.
 
Back
Top