[futurebasic] Re: [FB] Adjusting time

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 1999 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Mon, 23 Aug 1999 11:01:59 -0400
First let me express my sincerest gratitude to Joe Wilkins, who 
showed me how to write to the time adjustment engine, and Deepesh 
Letap for showing me how to call time data in a few lines of toolbox 
code. (Dang, I knew you could do it but the Toolbox still scares me!)

Can't figure out whether or not to thank Jim Henson who showed me 
that the whole thing won't work without referencing a universal time 
constant (GMT), but didn't offer any solutions! =8^{  (Just joking 
Jim-- your observation is vital!)

As a pilot, I should have realized the importance of GMT, but I was 
too focused on converting the time data to see where I was going. 
Ignored the first cockpit rule: Always scan your instruments!

Which leads me to:

1). Any suggestions on accessing the Time Zone data in the Date & 
Time control panel and using it as a basis for converting the 
computer's clock time to GMT?

2). The system clock works regardless if Date & Time is disabled. Any 
background way of determining the time zone the system clock is set 
for without Date & Time being active? (We're getting into the bowels 
here, and I'm lost.)

3). I ran Deep's toolbox clock call in the Command window, but found 
it would not consistently update when the HoursForward& variable was 
changed. I inserted a Clear Screen, but that didn't help. My guess is 
that for some reason it has to wait 60 seconds to refresh, but I 
don't understand why. Here's Deep's call again. Maybe some of you 
would be so nice as to run it and see if it refreshes when he 
variable is changed:

osErr%=FN READDATETIME(Seconds&)
REM Set HoursForward& to +/- time zone hours.
REM 0 is now, +1 is 1 hour forward, -2 is 2 hour backward, etc.


REM Set Format& to 0 for short and 1 for long format.
REM Leading Zeros set from Date & Time control panel.

CALL IUTIMESTRING(Seconds&,Format&,TimeResult$)

PRINT TimeResult$

Delay 2000

4). I know these things can be done, because I have seen clock 
applications that show the user's time zone compared with time zones 
around the world. Figuring it out is the hard part.

This time conversion routine will be put into my one-trick-pony "Area 
Code Index" application. I'm writing it to allow the user to see the 
exact time in any given telephone area code from Bermuda to Hawaii 
and Guam. (To preempt Jim the Swede: I do realize that some area 
codes span more than one time zone!)

A few years ago, built Area Code Index for my personal use, but have 
just updated it to include the latest NANPA revisions including 
recent overlays. (Telephone area codes are increasing almost 
exponentially as more cell phones, fax machines, etc. come on line 
and its a job keeping updated.) Eventually I hope to allow the user 
an option of opening a map of a given state to see the boundaries of 
each area code zone. If any list members would like a beta, let me 
know. Bug reports are appreciated.
Ken Shmidheiser               Systems Administrator/General Manager

Internet: kshmidheiser@...    Fax:  606.679.9225
Somerset, KY 42502-0221                        Phone:  606.679.4266