Skip to content

How to store and use the date and time #140

Answered by Makuna
Michael-pi-projects asked this question in Q&A
Discussion options

You must be logged in to vote

The current date time returned from the RTC is a RtcDateTime object.

The easiest way to store this is to call Epoch32Time() which returns a 32bit value that you can store.
Then you retrieve that stored value and pass to InitWithEpoch32Time(uint32_t time) to create an RtcDateTime object again.

Epoch time is a standard, the RtcDateTime object supports both 32 bit and 64 bit versions.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Michael-pi-projects
Comment options

@Michael-pi-projects
Comment options

@Makuna
Comment options

@Michael-pi-projects
Comment options

@Makuna
Comment options

Answer selected by Makuna
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants