.Setdata Method (Previously .Set)


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.


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


Notice, 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.set method is executed at least once. Incorrect behavior may include failure to increment or incrementing at an abnormal rate. Rtc.running cannot be used to reliably check RTC state in this situation.

It is not necessary to use rtc.set 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 "stor" 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/C sees "stor" and "set" as separate entities and "set" is a reserved word that can't be used.