Lparameters lcServerHD If Pcount()=0 or DriveType(justdrive(lcServerHD))#4 Return .null. && Wrong server path EndIf Local lcTempfile, ltTime, ldDate, ldDatetime Local array laDummy(1) lcTempFile=Addbs(lcServerHD) + 'tmp' + sys(2015) && a temp file on your server strtofile('a',lcTempFile) ADir(laDummy,lcTempFile) ltTime=Ctot((laDummy(1,4))) ldDate=(laDummy(1,3)) eras (lcTempFile) ldDatetime=Datetime(Year(ldDate),Month(ldDate),day(ldDate),Hour(ltTime),Minute(ltTime),sec(ltTime)) Return ldDatetimeTo use it : ldDatetime=servertime('p:') where p: is a mapped drive on your server.
> >* 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 > >