Time conversion and vb.net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paulers

    #1

    Time conversion and vb.net

    Hello,

    I'm working on an app that requires the functionality to convert the
    time in Austrailia to the time in New York (EST). I am wondering, what
    is the bestway to approach this in vb.net? Is there anything in VB.net
    that can make this conversion? If not, is it possible to hit a time
    server of some sort to get the conversion? I know there are time
    conversion websites all over the place Im just wondering if any of them
    allow an application to query it for time. I also need to account for
    DST in both locations. I know, sounds tricky hehe :) Any help is
    greatly appreciated.

  • Cor Ligthert [MVP]

    #2
    Re: Time conversion and vb.net

    Paulers,

    AFAIK is there nothing as you ask, however in my opinion is this simple as
    long as the countries are using a full timezone.

    Just create a hashtable with values accoording to UCT (GMT or Zulu) an
    calculate it.

    http://msdn.microsoft.com/library/de...hourstopic.asp

    Or your problem should be to find in what timezone is a village.

    By just using "timezones" as search argument you find a bunch on Google by
    instance this one

    World Time Zone map and current time around the World and standard world time zones map of the world and countries operating Daylight Savings Time sunclock map shows what part of the world is in darkness and what part is in daylight detailed time zone maps of the USA time Europe time Australia time Canada time Middle-East time Oceania time Russia time zone Interactive Time Map for time in relation to other locations around the world


    I hope this helps,

    Cor


    Comment

    • Paulers

      #3
      Re: Time conversion and vb.net

      Thanks for the response Cor,

      What values am I adding to the hastable and does this method account
      for DST. Any way you can show me an example of what you mean? I
      appreciate all your help.

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Time conversion and vb.net

        Paulers,

        I have no sample.

        However, you set every timezone in the hashtable with its value accoording
        to UTC, So CET has value -1.

        Then it should be easy to calculate the time between GMT and CET because
        that is -1, where is the - from the view that you are looking at it. (It is
        1 hour earlier 12 O'Clock in Amsterdam than in London or it is in London 1
        hour later 12 O'Clock than in Amsterdam)..

        Etc.

        I hope this helps,

        Cor


        Comment

        • Paulers

          #5
          Re: Time conversion and vb.net

          Hi Cor,

          ok I found a ToUniversalTime method that will convert New Zealand
          datetime to UTC time. Once I have the time converted to UTC I need to
          take away 5 hours (-5) to arrive at EST correct?. Is there an easy way
          to calculate this in vb.net that will take care of the spanning
          midnight and other things that need to be accounted for when performing
          datetime calculations?I guess I am looking for a method that I can pass
          it +5 or -5 (in some form or other) and have it return a processed
          datetime object. does that exist?

          thanks! :)

          Comment

          • Cor Ligthert [MVP]

            #6
            Re: Time conversion and vb.net

            Paulers,

            I gave you that in my idea in the link in my previous message.

            Cor


            "Paulers" <SuperGh0d@gmai l.com> schreef in bericht
            news:1139797742 .611912.231940@ g44g2000cwa.goo glegroups.com.. .[color=blue]
            > Hi Cor,
            >
            > ok I found a ToUniversalTime method that will convert New Zealand
            > datetime to UTC time. Once I have the time converted to UTC I need to
            > take away 5 hours (-5) to arrive at EST correct?. Is there an easy way
            > to calculate this in vb.net that will take care of the spanning
            > midnight and other things that need to be accounted for when performing
            > datetime calculations?I guess I am looking for a method that I can pass
            > it +5 or -5 (in some form or other) and have it return a processed
            > datetime object. does that exist?
            >
            > thanks! :)
            >[/color]


            Comment

            Working...