Bug: wrong year from getClock() function
Opened this issue · 1 comments
vsupacha commented
Error:
Always return 20 as year.
Cause:
- Wrong index when parsing return text from AT+CCLK command.
- The response is "+CCLK: YY/MM/DD HH:MM:SS", so there is one space before year.
- The code at line 831 will concatenate "20" with " 23" and convert to int, then the result will be always 20 instead of 2023.
unsigned int yy = ("20" + dateTime.date.substring(0, index)).toInt();
Solution:
Change starting index to 1.
unsigned int yy = ("20" + dateTime.date.substring(1, index)).toInt();
AIS-DeviceInnovation commented
Thank you, we will update to fix it soon