Note that the LMX_GetSystemClockTime API call was introduced in LM-X v4.9.20. This API call is not available in previous releases of LM-X. |
The LMX_GetSystemClockTime function returns the system time and performs a system clock check based on a checked out feature.
Prototype
LMX_STATUS LMX_GetSystemClockTime ( LMX_HANDLE LmxHandle, const char *szFeatureName, time_t *pTime );
Parameters
LmxHandle
[in] LM-X handle.
szFeatureName
[in] Feature name.
pTime
[out] Address of time_t variable.
Return values
On success, this function returns the status code LMX_SUCCESS.
On failure, this function returns an error code in the format described in Return codes.
Remarks
This function validates the system clock time based on a checked out feature, providing a safe way to determine whether a user has changed the time on their system. The system clock check type depends on the feature, as detailed in SYSTEMCLOCKCHECK.
Note that the internet clock check will allow a difference of ±24 hours when checking the system clock time.
Example
The following code shows an example of using this API call.
time_t Time; LMX_STATUS LmxStat = LMX_GetSystemClockTime(LmxHandle, "feature", &Time); if (LmxStatus == LMX_BAD_SYSTEMCLOCK) printf("System clock has been changed!\n");