Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,179 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,999 people online right now. Registration is fast and FREE... Join Now!




Calculating Time and Date with different Zone

 
Reply to this topicStart new topic

Calculating Time and Date with different Zone

priya2345
19 Aug, 2007 - 01:34 AM
Post #1

New D.I.C Head
*

Joined: 19 Aug, 2007
Posts: 8


My Contributions
Hello,

I want to create a tool to calculate the new date and time according to the zone selected

For example
1. how do I calculate the new time by adding 2 hrs and 20 minutes to the current time
2. How do I calculate the new date and time for different zones like EST

My system follows the IST

I tried using DateTime, Now but couldn't get the correct answes


Thanks in advance

User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Calculating Time And Date With Different Zone
19 Aug, 2007 - 11:39 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Research the DataAdd, DateDiff, DatePart function in VB6. Once you have done that and tried writing some code to accomplish this and run into problems, then post your code here with a nice explanation of your problem and we'll help smile.gif
User is offlineProfile CardPM
+Quote Post

priya2345
RE: Calculating Time And Date With Different Zone
20 Aug, 2007 - 04:53 AM
Post #3

New D.I.C Head
*

Joined: 19 Aug, 2007
Posts: 8


My Contributions
Thanks for the ideas

I tried with DateAdd and was successful in calculating the Time
I calculated the EST by subtracting 570 mins(9.30 hrs) from the current IST time

Now I am stuck on calculating the new date for ex.
If the IST is 6:00 AM of Aug 20 then the EST is 8:30 PM of Aug 19.
I am getting the 8:30 part correct, but unable to get Aug 19 as the new date according to EST

Any ideas on this.

Thanks

User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Calculating Time And Date With Different Zone
22 Aug, 2007 - 08:53 AM
Post #4

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,906



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
I think that will be taken care of if you specify the Date as well instead of just the time in the Date variable.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 01:04AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month