Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_date( [ <lsynchronize> ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_DATE( [ <lSynchronize> ] )


Parameter

<lSynchronize>
Optionally set the local station's date to that of the server.

           .T. synchronizes dates.
           .F. does not synchronize. (Default)



Returns

Current system date from server.


Description

N_DATE() works like the Clipper DATE(), but uses the server's clock. 
Thus, N_DATE() should return the same value on all stations, whereas 
DATE() might vary from station to station depending on whether each 
station's clock had been synchronized with the server's.

N_DATE(.T.), in addition to returning the server's date will also set 
the local station's date to that of the server.

If running in stand-alone mode, N_DATE() uses the local clock and thus 
returns the same value as DATE().


Example

// Use server's time to make sure all
// transactions have correct time stamp.
REPLACE TransDate WITH N_DATE(), ;
        TransTime WITH N_TIME()

// Make sure the application is using correct date
IF N_READY()
   N_DATE(.T.)
ENDIF

// Synchronize workstation's clock with the server
IF N_READY()
   ...
   N_DATE(.T.)
ENDIF



See Also: N_SECONDS() N_TIME()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson