2023-09-05 04:38 AM
Hello st community, I work on stm32F4, and I use with RTC for date time.
When I write in RTC a wrong day (for example 30 Feb 2023 or 31 Apr 2023) I havent a error in the result.
It is possible to ask if the data is correct ?
if (HAL_RTC_SetDate(&hrtc, &sDate_present_tmp, RTC_FORMAT_BIN) == HAL_OK)
Solved! Go to Solution.
2023-09-05 09:17 AM - edited 2023-09-05 09:17 AM
Pretty sure it's not responsible for range checking your input. That's really going to fall on to code you have to check user input, for things like leap years, and days in the month, etc.
2023-09-05 04:42 AM - edited 2023-09-05 04:46 AM
Hello @IlConte
Since you have the ability to programme the date ( the exact date) then is impossible to verify if the RTC date is true or not.
Best regards.
II
2023-09-05 08:54 AM
Hello @IlConte,
Could you share a code snippet of RTC configuration
Also, which clock source are you using?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-09-05 09:17 AM - edited 2023-09-05 09:17 AM
Pretty sure it's not responsible for range checking your input. That's really going to fall on to code you have to check user input, for things like leap years, and days in the month, etc.
2023-09-05 11:56 PM
Thanks I add checkin month / date in the input