Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Secure system clock and user clock

Brew MP provides two clocks:

  • The user clock provides the time in the user's location
  • The secure system clock provides an accurate, valid clock

User clock

The user clock is an implementation of ISysClock (AEECLSID_SysClock). The time indicated by the user clock can vary depending on the time zone and may not have the same value as the secure system clock.

The time represented by the user clock is a leap second compensated offset to the epoch of Midnight Jan 6, 1980 UTC. This offset can be converted to a user-friendly date and time using the GETJULIANDATE helper function, or the stdTime_AddSeconds() function.

Secure system clock

The secure system clock cannot be set by the user. It is the most accurate clock and does not vary by time zone. It can be used to check time-based licenses, and can also be used for logging and for protocol implementations.

The time represented by the secure system clock is a leap second compensated offset to the epoch of Midnight Jan 6, 1980 UTC.

The secure system clock is considered invalid when it has not been set from a secure source. If the time is invalid, calls to retrieve the time return an error code. When an application calls ISysClock_GetTimeS() or ISysClock_GetTimeUS(), the time is returned even when the clock is invalid. The caller should always check the return code to verify that returned time is valid.