?
Solved

Disable daylight savings time

Posted on 2005-04-21
7
Medium Priority
?
467 Views
Last Modified: 2007-12-19
Hi,

Any one knows how to disable or uncheck "Automatically adjust clock for daylight saving changes" in Time Zone settings?

Thanks a lot.

Joe
0
Comment
Question by:Joe_Shen
  • 5
  • 2
7 Comments
 
LVL 8

Expert Comment

by:mugman21
ID: 13840597
Sure thing,

You need to change it in your registry. The key that needs to be changed is outlined here:

http://www.winguides.com/registry/display.php/1283/

I don't know how much programming experiance you have, if you need a little help in registry writes, just ask...

Mugman
0
 

Author Comment

by:Joe_Shen
ID: 13844665
Thanks a lot, Mugman.

Sorry for reply late since I was tighted up with something else.

I am just VB beginner, could you email me some codes of  how to get this done? my email is:
zqshen@juno.com

Again, Thank you for your help.

Joe

0
 
LVL 8

Expert Comment

by:mugman21
ID: 13849048
Joe, I'll post some code here along with a link to the need class module just so this question can be PAQ'ed for others that might want to know this. I'll zip the sample project and email it to you.

Mugman
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:mugman21
ID: 13849056
To create a project that will test whether automatic daylight savings is enabled or disabled, first download the class module from
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=57232&lngWId=1

Create a project, add a form and two command buttons using the default names. Add the following code to Form1:

'-----------------------------------------------------------------------------------------------------------------------------------

Dim reg As clsRegistryAccess

Private Sub Form_Load()
'create the object
Set reg = New clsRegistryAccess
End Sub

Private Sub Command1_Click()
Dim DoesExist As Boolean
Dim KeysValue As Long

'determine if the key even exist
DoesExist = reg.ValueExists("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation", "DisableAutoDaylightTimeSet")

If DoesExist = False Then
'if the keyvalue does not even exist, = false, then daylightsavings is on by default
MsgBox "This system will automatically adjust for daylightsavings"
Else
'if key does exist, lets read it and check it's value
KeysValue = reg.ReadDWORD("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation", "DisableAutoDaylightTimeSet")

If KeysValue = 0 Then
MsgBox "daylightsavings is enabled"
ElseIf KeysValue = 1 Then
MsgBox "daylightsavings is disabled"
End If

End If
End Sub

Private Sub Command2_Click()
'if the key exist, we'll rewrite over it or if not, we'll create and set it
reg.CreateKeyIfDoesntExists = True
reg.WriteDWORD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation", "DisableAutoDaylightTimeSet", 1

End Sub
0
 
LVL 8

Expert Comment

by:mugman21
ID: 13849058
and if it is Enabled, click Command2 and it will create the appropriate key and disable it.....

Mugman
0
 
LVL 8

Accepted Solution

by:
mugman21 earned 1000 total points
ID: 13853015
Joe_Shen,

How did that code work for you? Just curious if you had any sort of problem with it... If you had any problems, drop me a line.

Mugman
0
 

Author Comment

by:Joe_Shen
ID: 13861729
Thanks, Mugman

Your codes work perfectly. Sorry for late reply again.

Wish you the best.

Joe
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question