.Setdata Method (Previously .Set)

Top  Previous  Next

 

Function:

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

Syntax:

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

Returns:

---

See Also:

RTC Object

 


Part

Description

daycount

Number of elapsed days.

mincount

Number of elapsed minutes.

seconds

Number of elapsed seconds.

Details

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).

 

note_warning-wt

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.

 

note_tip-wt

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.