Seconds(), Sys(2)
SECONDS() returns a numeric value of the number of seconds since midnight, with a resolution of one millisecond. SYS(2) returns a character string of the same number, formatted as five digits with no decimal places.
Usage |
nRetVal = SECONDS() cTime = SYS(2) |
The SECONDS() function grabs the time when FoxPro starts and stores it in some hidden nook or cranny. Changing the system time while FoxPro is running is not reflected in the SECONDS() function, although TIME() and DATETIME() do seem to pick it up. |
Strangely enough, the SECONDS() function, while ignoring other changes, does note that midnight has passed during the current session and resets SECONDS() to zero. This can be very useful if you are capturing seconds since midnight in an application that might need to run for several days. This was a notorious 2.x bug, squashed finally in 3.0. |
Example |
lcStopTime = SYS(2) lnStartTime = SECONDS() |
See Also |