Check for daylight saving time with WMI on Vista/Win7

Tagged:

How do I find out if the computer I'm on has daylight saving time in effect? (preferably using WMI)

According to this article at TechNet, I could query SELECT DaylightInEffect FROM Win32_ComputerSystem, but the property DaylightInEffect is not supported on Vista or Win7. As my program will run on various systems (XP, Vista, 7), I would appreciate some portable way of finding out.


PiskvorH
2009-11-25 15:36:18 Scores:0

1 answer

Answer 1
Scores:1

The documented supported OS list is not accurate, this works fine on Win7 when I try it. I can't think of any reason it wouldn't be supported on any other OS, it is easy to find out with the Win32 API (GetTimeZoneInformation).

You can use WmiCodeCreator for a quick check.

Hans Passant H
2009-11-26 17:33:10
Indeed, it seems to work in practice. Yay for undocumented API.
Piskvor H
2009-11-26 21:03:44 Scores:0
Share |
View original post at stackoverflow.com

Related topics

Where is the Daylight saving time setting in Windows 7?

I can't find how to disable the Daylight saving time option in windows7 ! ...

Summer daylight time not changing on some active directory domain clients

We just had a summer daylight change in US. and pc's on my network are behaving strange, some of them change time and some didn't. My network: 2 locations both in Midwest, same time zone. Location 1: 120 pcs (windows xp & windows 200) , with 1 Active Direcotry Domain ...

Windows desktop (XP, Vista or Win7) EC2 AMI for QA testing

I need to perform QA testing for Windows based applications on a Windows desktop client and I would like to know if EC2 supports Windows images that are NOT server based (e.g. Server 2003). I have searched and found many posts that suggest that Amazon does not have desktop clients ...

How do I remotely set the timezone and daylight savings time settings of Windows domain computers?

How can I remotely control/change timezone and Daylight Savings Time (DST) settings of Windows domain computers? ...

how did my laptop lose daylight savings time on power loss?

it was an old laptop that may or may not have dead CMOS battery (at least it had time reset to 0 when I dusted it off). So, it was plugged into power for awhile without the main battery and the clock was correct. Then there was a power outage. ...

vista/win7 magnification API in .NET

There is magnification.lib in win7/vista SDK for using magnification API for C++ (http://msdn.microsoft.com/en-us/library/ms692162%28VS.85%29.aspx). How can I use this API in .NET windows forms project? Thank you for any advice. ...

Vista/win7 application volume control interface

Which interface should I use to control the volume of my application on Vista or Windows 7? The programming language doesn't matter. ...

How to check a file saving is complete using Python?

I am trying to automate a downloading process. In this I want to know, whether a particular file's save is completed or not. The scenario is like this. Open a site address using either Chrome or Firefox (any browser) Save the page to disk using 'Crtl + S' (I work on windows) Now ...

Changing codepage in .bat file (Win7 vs Win Vista)

I have a strange issue while trying to change the codepage in a .bat file. When I execute the following .bat file in Windows 7 it executes fine. The codepage gets changed and program.exe get executed. The batch file: chcp 65001 "D:\program.exe" /opt ÄiÜ pause However when I start the .bat file from Windows Vista the codepage ...

javascript incorrectly determines daylight savings time line -- an example out of 2006

I have read many StackOverflow questions on the javascript new Date() object when it comes to daylight savings time lines -- as in when they are crossed. However, I haven't seen an answer about this particular problem or a way to work around it while still relying on 'unix time'. I ...