Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stuck System Clock?
Message
From
24/11/2010 04:07:10
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01490235
Message ID:
01490325
Views:
42
You should really try to use a centrally synched time. Tore suggested one approach. Another would be to run "NET TIME \\computername /SET /Y" occasionally.
If the app re-starts on a regular basis then running it at startup should be enough for your purposes. Running it at point of failure with your current code wouldn't work if there was an errant machine that was *ahead* of the system clock since it would never get synched and the other machines would never catch up after it contributed a time stamp...

>YES, This was it!! - You are absolutely correct.
>
>I had not consider that another station CLOCK may not be in Sync.
>So, I changed the prompt read "Please verify System Clock is in Sync on all stations).
>
>Thanks everybody for your inputs. This is indeed a great forum.
>Cyrus
>
>
>>>I use Time Stamps in my App and have a Function that retrieves unique Time Stamps.
>>>
>>>I have a sitation with one system (so far) that is returning the "The system clock seems to be stuck" message in the code below.
>>>How is this even possible ?! - And if something wierd is actually causing it, how can it be fixed ?
>>>
>>>
>>>
>>>
>>>* MFS_TRAN.TRANS_ID - Contains the last DATETIME() value from the previous call.
>>>
>>>ngCount = 0
>>>timeStamp = DATETIME() 
>>>IF timeStamp > MFS_TRAN.TRANS_ID 
>>>   * we're home!
>>>ELSE   
>>>   * This case should only happen if last call was less than a seconds ago.
>>>   DO WHILE timeStamp <= MFS_TRAN.TRANS_ID
>>>      ngCount = ngCount + 1
>>>      WAIT '' TIMEOUT 1  
>>>      timeStamp = DATETIME()  && By this 1 second delay, we MUST get a fresh Time Stamp 
>>>      * but lets check it anyway. 
>>>      IF timeSTamp <= MFS_TRAN.TRANS_ID .AND. ngCount > 10  && we have looped 10 times with 1 second delay. 
>>>
>>>         WAIT '-- The system Clock seems to be stuck....' + CR + ;
>>>              '      (press any key to continue)'  WINDOW  TIMEOUT 5
>>>
>>>         EXIT  && Send your best time stamp.
>>>      ENDIF  
>>>   ENDDO
>>>ENDIF   
>>>REPLACE MFS_TRAN.TRANS_ID WITH timeStamp
>>>RETURN timeSTamp
>>>
>>>
>>
>>First the obvious question : Is the MFS_TRAN.TRANS_ID value used by different machines ?
>>If not then is the machine in question configured to automatically re-sync with a time server ?
Previous
Reply
Map
View

Click here to load this message in the networking platform