Skip to content

Hi - I'm new to the community. I 've started using the library which is very useful. I have a similar question to the above post: In my case I want to set the time from a variable. Something like: #133

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

You must be logged in to vote

@RussellSher First, your example doesn't even compile. if you look at the Wiki for RTC, there is no SetDateTime that takes a string; it takes a RtcDateTime object.

If you then look at this Wiki entry on the constructors for RtcDateTime you will notice that RtcDateTime can be initialized without using a string at all.

Review the examples, they demonstrate the creation of a RtcDateTime object and just construct one using the RtcDateTime(uint16_t year, uint8_t month, uint8_t dayOfMonth, uint8_t hour, uint8_t minute, uint8_t second) constructor.

Replies: 2 comments 2 replies

Comment options

Makuna
Nov 20, 2021
Maintainer Author

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

Answer selected by Makuna
Comment options

Makuna
Nov 20, 2021
Maintainer Author

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

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
Converted from issue

This discussion was converted from issue #132 on November 20, 2021 17:50.