CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2000
    Location
    Hawaii
    Posts
    19

    World Timezones Alarm

    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


  2. #2
    Join Date
    Feb 2000
    Location
    Ireland
    Posts
    808

    Re: World Timezones Alarm

    use the GetTimeZoneInformation API
    have a look at http://www.planetsourcecode.com for examples there are plenty there for how to use it


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured