Subj : Remote - Local Time synchro To : Gerald Miller From : Jasen Betts Date : Sun Jul 21 2002 09:11 am Hi Gerald. 19-Jul-02 16:30:48, Gerald Miller wrote to Jasen Betts GM> Hello Jasen, GM> On Friday July 19 2002 at 07:43, Jasen Betts [3:640/531.42] wrote GM> to Gerald Miller, about: Remote - Local Time synchro GM>>> Remote Time is: [61205] 17:00:05 LOCAL Time is: [61230] 17:00:30 GM>>> The Remote site is SLOWER by: 00:00:25 Action is: - GM>>> (subtraction) of: 00:00:25 from current LOCAL time... Do GM>>> you wish to make an adjustment? GM>>> Now, I have to decide how the adjustments are to be made and if GM>>> I should let an "X" number of seconds #_slide_by_# before any GM>>> notification of adjustments..... ??? Suggestions ??? JB>> I'd just put a message in the log file and change the system time JB>> (unless the mailer event was less than the time taken) GM> I #think# that is the method that FrontDoor uses to synch systems GM> and it's unavailable to me.... When the event is running (making GM> the connection, the "handshake", the file exchanges...) the log GM> file is locked (in use) by 'Frodo'..... :)) Just pretend that it happened during the event. JB>> Still a delay of 5 seconds isn't going to be a big problem JB>> either. you may want to ignore differences of greater than a JB>> certain amount (if the remote end sets their clock wrong....) GM> If I am within fifteen seconds (either way) of my Host, then the GM> time is acceptable. JB>> if you want you could use inkey to delay and if the use doesn't JB>> say no include the inkey delay could be the synchronisation JB>> delay. GM> This sounds appealing... Would you provide an example? assuming %localtime and %remotetime are the times read from the logfile. set correction = %@eval[(%@maketime[%remotetime]-%@time[%localtime] %+ +43200 ) %% 86400 - 43200 ]] :: %correction is the time difference seconds, :: and is negative if your computer is fast. iff %correction lt -1 set z= inkey /w%@eval[%correction *-1] Correcting time: "c" to cancel /KC %%z if "%z" ne "c" time %@maketime[%@eval[(%@time[%_time]+%correction)%%86400]] set z= elseiff %correction gt i :: correct time forwards - no waiting time %@maketime[%@eval[(%@time[%_time]+%correction)%%86400]] endiff JB>> most times you'll probably only have to adjust by a few seconds JB>> (if you only get 1 second difference probably you should ignore JB>> it because it could really be less than one second) GM> It's a math problem...... yes, a rounding error. GM> This doesn't work, yet I can't see where my error is.... it looks to me like you're trying too hard. /---* (ZZZ) GM> case y GM> unset /q reply %+ ( GM> iff "%act"==" + (addition)" then %+ why not always use addition, 4dos understands negative numbers. GM> set today=%@eval[%@date[%_date]*86400 + %@time[%_time]] GM> set now=%@eval[%today + %@time[%amount]] GM> set newtime=%@maketime[%@eval[%now %% 86400]] GM> time %newtime GM> echo Revised time is: %_time GM> This doesn't work, yet I can't see where my error is.... time sets the time to a few milliseconds before the time you ask for. could that be the problem? OTOH %act or %amount could have the wrong value... GM> -!- GoldED+/386 v1.1.5-20617 GM> - Origin: As the Iron Curtain rusts. (1:342/512) -=> Bye <=- *---/ -=> Bye <=- --- # Origin: The sun is not made of earthly fire. Quite the revers (3:640/531.42) * Origin: Baddog BBS (1:218/903) .