# Calculating Time and Date with different Zone

Page 1 of 1

## 3 Replies - 6073 Views - Last Post: 22 August 2007 - 09:53 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=31894&amp;s=6ab5d96bacb3507f8eb57693ab0c2205&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 priya2345

• New D.I.C Head

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

# Calculating Time and Date with different Zone

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

• Google.Sucks.Init(true);

Reputation: 1659
• 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

• New D.I.C Head

Reputation: 0
• 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

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

Reputation: 187
• 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

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }