Facing problem with creating different timezone on a vb form

Reply

Join Date: Nov 2007
Posts: 3
Reputation: mohammadhaneef is an unknown quantity at this point 
Solved Threads: 0
mohammadhaneef mohammadhaneef is offline Offline
Newbie Poster

Facing problem with creating different timezone on a vb form

 
0
  #1
Nov 5th, 2007
Please note this is in Visual Basic 6.0 language not .net :

I am facing alot of probem while creating a program which can show 5 different timezone of US on a form on 5 different label in connection with the system time.

for Eg
label1.caption "should be IST" Indian stan time
label2.caption "should be GMT" Green wich mean time
label3.caption "should be PST" Pacific Time
label4.caption "should be MST" Mountain Time
label5.caption "should be EST" Eastern time

This should work in connection with the system time, for eg: if its 18:00 hrs system time here, then EST ie: Label3.caption should be 08:00 hrs. 6 hours before our time.

Any help would really be appreciated.
Last edited by mohammadhaneef; Nov 5th, 2007 at 4:36 pm.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: Facing problem with creating different timezone on a vb form

 
0
  #2
Nov 5th, 2007
What will you consider as the base time?
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: Facing problem with creating different timezone on a vb form

 
0
  #3
Nov 5th, 2007
If you know the base time then based on the current time you can use something like this:

Assuming EST as the base time

CST = DateAdd("h", -1, Now)
MST = DateAdd("h", -2, Now)
PST = DateAdd("h", -3, Now)

So on..
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3
Reputation: mohammadhaneef is an unknown quantity at this point 
Solved Threads: 0
mohammadhaneef mohammadhaneef is offline Offline
Newbie Poster

Re: Facing problem with creating different timezone on a vb form

 
0
  #4
Nov 5th, 2007
Originally Posted by binoj_daniel View Post
If you know the base time then based on the current time you can use something like this:

Assuming EST as the base time

CST = DateAdd("h", -1, Now)
MST = DateAdd("h", -2, Now)
PST = DateAdd("h", -3, Now)

So on..
Base time would be the system time
and label should display the time 6 HOURS before the system time and so on.

system time 18:20:20 the Label time should be
12:20:20 hrs.

Based on reply would this code fetch me the Date or Time or Both. Please reply in detail
Last edited by mohammadhaneef; Nov 5th, 2007 at 5:26 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3
Reputation: mohammadhaneef is an unknown quantity at this point 
Solved Threads: 0
mohammadhaneef mohammadhaneef is offline Offline
Newbie Poster

Re: Facing problem with creating different timezone on a vb form

 
0
  #5
Nov 6th, 2007
Originally Posted by mohammadhaneef View Post
Base time would be the system time
and label should display the time 6 HOURS before the system time and so on.

system time 18:20:20 the Label time should be
12:20:20 hrs.

Based on reply would this code fetch me the Date or Time or Both. Please reply in detail
Thanks buddy the code worked as told be you but there is a slight problem with the minutes as that remains the same (The hour time increases or decreases but the minutes dont change) unfortunate enough I tried other alterations but it wont accept.

Please see if you can help,

If the Base time is 18:00:00 then the form time should be 06:30:00.

Thanks again
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC