Click to See Complete Forum and Search --> : World Timezones Alarm


Aiianah
July 12th, 2001, 05:31 AM
Hello everyone!

I'm trying to make an alarm clock based on world time zones but I'm having a hard time figuring it out...For example, if I want to display New York time in my program, I would use the DateAdd Function to apply an offset from my current time. Here is a sample below:

Dim NYTime As Date
Dim UserTime As String

UserTime = Format(Time, "hh:mm")
'returns the current time locally

NYTime = DateAdd("h", +3, UserTime)
'apply offset of New York time


The value for New York will only show the "true New York Time" when UserTime returns GMT +1 (my local time), but what if the user of my program resides in GMT +3? Then my New York time won't return the value I planned at design time. So my question is this:

How do I get to the Time Zone setting of the Date/Time properties of my user's system?

Thank you very much for the assistance.

Very Respectfully,

Aiianah

TH1
July 12th, 2001, 06:09 AM
use the GetTimeZoneInformation API
have a look at http://www.planetsourcecode.com for examples there are plenty there for how to use it