.getdata Method
Function: |
Returns current RTC data as the number of elapsed days, minutes and seconds. |
Syntax: |
rtc.getdata(byref daycount as word, byref mincount as word, byref seconds as byte) |
Returns: |
Number of elapsed days, minutes, and seconds. Notice that this is done indirectly, through byref arguments. |
See Also: |
Part |
Description |
daycount |
Number of elapsed days. |
mincount |
Number of elapsed minutes. |
seconds |
Number of elapsed seconds. |
Details
Most platforms include a set of convenient date and time conversion functions that can be used to transform "elapsed time" values into the current weekday, date, and time (see weekday, year, month, date, hours, minutes).
Note that after the device powers up, and provided that the backup power was not present at all times, the RTC may be in the undetermined state and not work properly until the rtc.setdata method is executed at least once. Incorrect behavior may include failure to increment or incrementing at an abnormal rate. The rtc.running read-only property cannot be used to reliably check the RTC state in this situation.
It is not necessary to use rtc.setdata if the backup power was present at all times while the device was off.
With Tibbo BASIC/C release V2, this method had to be renamed from .get to .getdata. This is because the period (".") separating "rtc" from "getdata" is now a "true" part of the language (i.e., it is recognized as a syntax unit, not just part of identifier). Hence, Tibbo BASIC and C see "rtc" and "get" as separate entities and "get" is a reserved word that can't be used.