473,769 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.

Feb 11 '06 #1
5 4677
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

http://www.worldtimezone.com/

I hope this helps,

Cor
Feb 11 '06 #2
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.

Feb 11 '06 #3
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
Feb 12 '06 #4
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! :)

Feb 13 '06 #5
Paulers,

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

Cor
"Paulers" <Su*******@gmai l.com> schreef in bericht
news:11******** **************@ g44g2000cwa.goo glegroups.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! :)

Feb 13 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
11717
by: dan glenn | last post by:
Say, I want to set a cookie and have it expire an hour after it's set. It's looking like this is only possible for browsers which are in the same time zone as my server?? In other words, if I set my cookie with: setcookie('CookieName', $SomeValue, time()+3600, "/");
2
2815
by: learning_C++ | last post by:
I programmed this code with a function "get_current_time" in the begining. When I compiled with the command g++ -Wall -g xxx.xpp -o xxx there are so many errors. please help me and thanks, #include <map> #include <iostream> #include <iomanip> #include <string> #include <time.h>
1
11685
by: heirou | last post by:
I'm a novice in this subject....I've made a database that requires a time conversion. For example, if local time is 1200, determine the time in Korea. I use two fields: a date field, and a time field. I need the converted time to show up in a report. I also need the corresponding date to increment if necessary. Any ideas on how to do this would be greatly appreciated.
6
2069
by: DCSudolcan | last post by:
I know that a program can create and properly initialize an array of pointers to functions at build time, but can something like the following be done at build time? void foo(void); unsigned char myArray={ (unsigned char) (foo&0xFF), (unsigned char) ((foo&0xFF00)>>8), (unsigned char) ((foo&0xFF0000)>>16),
3
2889
by: Jason S | last post by:
is there any way to use templates to bind integer/floating point constants to a template for compile-time use? e.g. template <double conversion> class meters { const factor = conversion;
3
2758
by: moni | last post by:
Hi, I wanted to convert a time value in the form of time_t into a readable form in C# or vice versa, in order to be able to subtract two time values and give the result in msecs. eg. I have a time value,
3
2478
by: Evan Klitzke | last post by:
Although it is not present in ANSI C, the GNU version of stftime supports the conversion character %z, which is a time offset from GMT. The four digit time offset is required in RFC 2822 dates/times, and is used by a number of other programs as well. I need to convert times that use this convention to python time representations, and because Python does not support the %z time conversion character I cannot simply use the time.strptime...
5
3176
by: fimarn | last post by:
I am trying to get rid of compile time error that I am getting only in RHEL5 (not in RHEL4) apparently due to the changes in the stl_list.h file. The error that I am getting is coming from the following code that attempts to remove an item from the list: class shm_objptr_list : public std::list < void*, SharedMemAlloc<void * > {
5
8523
by: Grey Alien | last post by:
I need to convert timestamps that are given as the number of seconds that have elapsed since midnight UTC of January 1, 1970, (not counting leap seconds). It seems all of the std C functions expect positive offsets from this date and are incapable of working on dates preceeding the epoch (i.e. negative offsets) - which IMHO shows a remarkable lack of foresight - and is *just* a little bit annoying. Does anyone know of an algo I can...
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9851
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8863
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
3949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3556
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2811
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.