2016-09-08 04:16 AM
Hi,
when i use the RTC, which year i have to set due to the leap year compensation? There are just two BCD digits for the year so i have to save the start/offset year in code?
If now would be the year 2015. Do i have to set the year i the RTC module to 3 and save the offset 2012? Is year 0 a leap year in the RTC calendar? I can not find any definition in the reference manual.
Thanks
2016-09-08 06:58 AM
Hi,
Leap year occurs every four years, in years which are multiples of 4. For example, 2012was a leap year. An exception to that is any year which is a multiple of 100. For example,the year 2100 is not a leap year. A further exception is that years which are multiples of 400are indeed leap years. Hence, while 2100 is not a leap year, 2400 is.Regards2016-09-08 07:32 AM
Hi neumann.sascha,
As mentionned is the reference manua ; Part of ''Real-time clock'' , both leap year and 30-31 day months are managed automatically by the RTC state machine.''Compensations for 28-, 29- (leap year), 30-, and 31-day months are performed automatically. Daylight saving time compensation can also be performed.''-Hannibal-
2016-09-08 07:52 AM
The RTC can't calculate day-of-week, and is probably Julian, thus it does not need to know the century. Your application would need to perform a correction in the date/day of week three times in every 400 years, first time in 1. March 2100.
JW