I got help on the Forbot forum:
Changing inline: "display.print(hour);" to "display.print(hours);" and removing "if(hour < 10) display.print(1);".
I consider the topic closed.
Working code:
Attachments:
NTPclient.zip(1.48 KB)
You must be logged in to download this attachment.
Create an account, log in here and be active on the forum — ads won't appear. Earn points for registering and replying.
✨ The discussion revolves around issues with an ESP8266-based OLED clock code that correctly synchronizes minutes and the day of the week but fails with hours and dates. Users identified several coding errors, including incorrect calculations for year, month, and day. Suggested fixes included changing specific lines in the code to properly display the current time and date. A final solution involved modifying the display function to use the correct variable for hours. The user reported success after implementing these changes. Generated by the language model.