gmag11/NtpClient

DAY OF WEEK ADDITION CODE

ajaybnl opened this issue · 1 comments

Add The Following Lines in ntpClientLib.h BEFORE "protected:" line :
int weekday=0;

Add The Following Lines in ntpClientLib.cpp IN FUNCTION "time_t NTPClient::getTime ()" AFTER "setLastNTPSync (timeValue);" line :

long day = timeValue / 86400L;
weekday=(day+4) % 7;

Add NTP.weekday to your code (or add :
Serial.println(NTP.weekday)

💯 % DONE

INFO:
0=sunday
1=monday
...
6=Saturday

it will calculated for your timezone selected in the NTP example.
Cheers from AJAY (ajaybnl@ g m ail.com

This libs focus is synchronize time using Unix Time Format. Date and time operations are managed by Time Library. Check it there, thanks.