Start Back Next End
  
ZBasic System Library
138
ZBasic Microcontrollers
GetDateValue
Type
Function returning UnsignedInteger
Invocation
GetDateValue()
GetDateValue(dayNum)
Parameter
Method
Type
Description
dayNum
ByVal
integral
The day number to convert to year, month, day.
Discussion
This function decomposes a day number into the corresponding year, month and day components and
packs them into a 16-bit value as shown in the table below.  If the day number is omitted, the value of
Register.RTCDay is used.
Note that Register.RTCDay is initialized to zero on power-up or reset.  This day number corresponds to
January 1, 1999.
Date Value Fields
Bits
Position Mask
Description
15-9
&Hfe00
Year relative to 1999 (0 to 127)
8-5
&H01e0
Month (1 to 12)
4-0
&H001f
Day (1 to 31)
Compatibility
This subroutine is not available if the RTC is not enabled in your application.  Also, the second form of
this subroutine is not available in BasicX compatibility mode.
See Also
Previous page Top Next page