How to use GetTimeZoneInformation
Hi all,
I'm working on a dialog base application, dealing with the time zone details.
In the dialog box there is a text box to enter the time offset. Then user click the display button, on the next text box display the timezone name. If the given time offset have more than one timezone name, very first timezone name should be display.
That's my question.
I'm going to use Windows API for this. So that I want to read the timezone list. How can I do that using API with GetTimeZoneInformation()
Re: How to use GetTimeZoneInformation
As I've mentioned to you multiple times.. there is no such thing as a "Timezone List". The timezones aren't stored on the computer anywhere (that is.. you can't use some magical API to list the timezones for you). Its just as useless as having an API that prints the numbers 0-100 for you on screen.. useless.
GetTimeZoneInformation, gets the offset for you.. thats it. You have to pre-program the timezone names, and offsets into your program. Then, use GetTimeZoneInformation to determine what the offset is, and have the default selection correspond to that.
chem
1 Attachment(s)
Re: How to use GetTimeZoneInformation
Ok, I'll explain it in this way.
Say I have a time offset, as a example +6:00, and I want to find the time zone name. That mean I have to read the list in the registry. So how can I do that.
Here is the list I'm talking about.
Re: How to use GetTimeZoneInformation
Where is this list in the registry?
chem
Re: How to use GetTimeZoneInformation
This list is not in the registry, only the details of all time zones. Those are in following path.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones
Re: How to use GetTimeZoneInformation
I don't have that information in my registry..
chem
Re: How to use GetTimeZoneInformation
I've work on XP, how about you.
Re: How to use GetTimeZoneInformation
Re: How to use GetTimeZoneInformation
So it is there, actually not the list in my image. But all the details are provided. So, it should be there in the registry.
Re: How to use GetTimeZoneInformation
It isn't.. I just checked.
It could possibly be added there by a program you have installed..
chem
Re: How to use GetTimeZoneInformation
I don't have installed any program. How did you check the registry, I mean how to login.
Re: How to use GetTimeZoneInformation
Start >> Run >> regedit.
chem
Re: How to use GetTimeZoneInformation
Ok, using admin account as well? So it should be there.
Re: How to use GetTimeZoneInformation
Yes.. there is only an Administrator account on this PC.. theres nothing there.
chem
Re: How to use GetTimeZoneInformation
Oh dear, I don't why is that. I've check it on few machines and it is there in all of them.
Re: How to use GetTimeZoneInformation
Dose anyone know how to work with RegEnumValue() to enumerate the registry keys.