Time offset for Time Zone display? 
Author Message
 Time offset for Time Zone display?

Quote:

>I'm creating a simple form that display a map of the
>the US & the time in the different zones. For example:

>   Timer1.Interval = 1000

>   lblEastern.Caption = Time ' Update time display.
>   lblCentral.Caption = Time - 1 Hour
>   lblMountain.Caption = Time - 2 Hours
>   lblPacific.Caption = Time - 3 Hours

>My question: What should I subtract from the current
>time in order to get the correct offset? I tried
>subtracting 3600, but that returned a date from 1890!

>Any help, suggestions, etc greatly appreciated.

>- Kerry

  Subtract 1/24 for an hour. The time function returns a number representing
a fraction of a day - .75 would display as 9 PM.  Be aware that for negative
values the fractional part is treated as a positive, so you will have to
correct
for this by adding 1 if you go below 0.
  Your timer interval is irrelevant.

Bruce P. Sidell
http://www.*-*-*.com/ ~bsidell/moonrise.htm



Sat, 02 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting offset between time zones

2. Daylight saving - winter time - summer time - time zone

3. Daylight saving - winter time - summer time - time zone

4. Daylight saving - winter time - summer time - time zone

5. Determining Time Zones or Server Time

6. Add Time zone to time received field in message

7. time zones and daylight saving time

8. Formatting Time to GMT when current Time Zone not known

9. Time & Time Zones

10. UTC time and Time Zones

11. Format date/time in DTPicker to display AM/PM or 24 hour time

12. Help displaying remaining time until time X

 

 
Powered by phpBB® Forum Software