ZBasic System Library
Function returning UnsignedLong
The tick count to decompose.
This function decomposes a tick count into the equivalent hour, minute, second and fractional second
components and packs them into a 32-bit value as shown below. If the tick count is omitted, the value of
Register.RTCTick is used.
Note that Register.RTCTick is initialized to zero on power-up or reset. This corresponds to 0:00:00.
Time Value Fields
Hour (0 to 23)
Minute (0 to 59)
Second (0 to 59)
Fractional Second (0 to F_RTC_TICK-1)
The 'fractional second' field represents the accumulation of RTC ticks between each second. The floating
point equivalent of the seconds value represented by the converted time value can be calculated using
code like that shown in the example below.
Dim time as UnsignedLong
Dim seconds as Single
' compute the equivalent full and fractional seconds value
time = GetTimeValue()
seconds = CSng(Shr(time, 15) And &H3f) + _
CSng(time And &H7fff) / CSng(Register.RTCTickFrequency)
The first form of the function is not available if the RTC is not enabled in your application. Neither form is
supported in BasicX compatibility mode or on VM mode ZX devices.