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:
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. Summary generated by the language model.