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

DAY OF WEEK ADDITION CODE #84

Closed
ajaybnl opened this issue Feb 16, 2019 · 1 comment
Closed

DAY OF WEEK ADDITION CODE #84

ajaybnl opened this issue Feb 16, 2019 · 1 comment

Comments

@ajaybnl
Copy link

ajaybnl commented Feb 16, 2019

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

@gmag11
Copy link
Owner

gmag11 commented Mar 6, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants