|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Time conversion and vb.netHello,
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. 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/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationcalendarclassaddhourstopic.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 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. 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 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! :) Paulers,
I gave you that in my idea in the link in my previous message. Cor Show quoteHide quote "Paulers" <SuperG***@gmail.com> schreef in bericht news:1139797742.611912.231940@g44g2000cwa.googlegroups.com... > 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! :) >
DateDiff function returning incorrect results in asp.net 2.0 vb
SOAP Body Least Cost Formulations and Linear Programming Just-In-Time Debugging????? Find specific pattern in a string SImple ADO.Net problem Msg Box not displaying messages Error Logging? Howto Transfer data from the DataTable into a SQL Database Shared Variable... Help me please... |
|||||||||||||||||||||||