Skip to content

@id1402 asks: How do you set the date time from month, day, year values? #169

Answered by Makuna
Makuna asked this question in Q&A
Discussion options

You must be logged in to vote

To make sure the time is correct, check it like...

RtcDateTime timeNow(dateYear, dateMonth, dateDay, clockHour, clockMinute, clockSecond);
if (timeNow.IsValid()) {
    rtc.SetDateTime(timeNow);
}
else {
    // display error?
}

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Makuna
Comment options

Makuna Apr 28, 2023
Maintainer Author

Comment options

You must be logged in to vote
1 reply
@Makuna
Comment options

Makuna Apr 28, 2023
Maintainer Author

Answer selected by Makuna
Comment options

You must be logged in to vote
0 replies
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