2016-10-31 8:27 AM
For example : My date is 31.10.2016 . After 120 days later, what is my new date ?
Is it possible to know it on internal RTC module or maybe calculation?? (STM32F401) #rtc2016-10-31 8:44 AM
You'd need to compute based on established day, month, year relationships.
The RTC hardware is a relatively simple implementation, but doesn't provide a method to do math on the settings.2016-10-31 7:03 PM
There are several ways to perform date arithmetic. Search on Julian date for examples of handling date only math.
Another alternative is to use the C runtime functions in time.h. Convert date and time to a 32-bit seconds since fixed date, add offset in seconds and then convert back to date and time in BCD. Look at the mktime() and gmtime() methods.
Jack Peacock
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.