Time conversion and vb.net

P

Paulers

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.
 
C

Cor Ligthert [MVP]

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/d...emglobalizationcalendarclassaddhourstopic.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

http://www.worldtimezone.com/

I hope this helps,

Cor
 
P

Paulers

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.
 
C

Cor Ligthert [MVP]

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
 
P

Paulers

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! :)
 
C

Cor Ligthert [MVP]

Paulers,

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

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top