Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: wrong year from getClock() function #18

Open
vsupacha opened this issue Apr 18, 2023 · 1 comment
Open

Bug: wrong year from getClock() function #18

vsupacha opened this issue Apr 18, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@vsupacha
Copy link

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
Copy link
Owner

Thank you, we will update to fix it soon

@AIS-DeviceInnovation AIS-DeviceInnovation added the bug Something isn't working label Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants