I need some help understanding how to convert data types. I am using Adafruits RTClib to control a DS3231 RTC. I need to take the RTC data which is defined as
uint16_t year() const { return 2000U + yOff; }
and input it into a structure variable that is a int.
post.year = now.year;
I'm using Platformio and I get the following error:
src\main.cpp:104:23: error: cannot convert 'DateTime::year' from type 'uint16_t (DateTime::)() const {aka short unsigned int (DateTime::)() const}' to type 'int'
post.year = now.year;
How do I convert this variable without making any changes to Adafruit's RTClib class or the structure that defines post.year?