3 Replies - 6073 Views - Last Post: 22 August 2007 - 09:53 AM Rate Topic: -----

#1 priya2345   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 19-August 07

Calculating Time and Date with different Zone

Post icon  Posted 19 August 2007 - 02:34 AM

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

Is This A Good Question/Topic? 0
  • +

Replies To: Calculating Time and Date with different Zone

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Calculating Time and Date with different Zone

Posted 19 August 2007 - 12:39 PM

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 :)
Was This Post Helpful? 0
  • +
  • -

#3 priya2345   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 19-August 07

Re: Calculating Time and Date with different Zone

Posted 20 August 2007 - 05:53 AM

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
Was This Post Helpful? 0
  • +
  • -

#4 born2c0de   User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 187
  • View blog
  • Posts: 4,673
  • Joined: 26-November 04

Re: Calculating Time and Date with different Zone

Posted 22 August 2007 - 09:53 AM

I think that will be taken care of if you specify the Date as well instead of just the time in the Date variable.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1