.setdata Method


Presets the RTC with a number of elapsed days , minutes , and seconds.


rtc.setdata(daycount as word, mincount as word, seconds as byte)



See Also:

rtc. Object




Number of elapsed days.


Number of elapsed minutes.


Number of elapsed seconds.


Most platforms include a set of convenient date and time conversion functions that can be used to transform the actual date into "elapsed time" values (see daycount and mincount).

A warning note icon.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.

A tip note icon.With Tibbo BASIC/C release V2, this method had to be renamed from .set to .setdata. This is because the period (".") separating "rtc" from "setdata" 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 "set" as separate entities and "set" is a reserved word that can't be used.

.setdata Method