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

Update setTimeOffset #2

Open
0rinsb3lt opened this issue Oct 25, 2018 · 0 comments
Open

Update setTimeOffset #2

0rinsb3lt opened this issue Oct 25, 2018 · 0 comments

Comments

@0rinsb3lt
Copy link

I suggest adding a line to setTimeOffset() so that it changes mServerTime by the offset once the function is called.

Steps:

  1. getUnixTime()
  2. setTimeOffset(offset)
  3. getUnixTime()

Expected Behavior:

  • Return unix time + offset

Actual Behavior:

  • Return unix time

Changing:
void EasyNTPClient::setTimeOffset (int offset) { this->mOffset = offset; }
to:
void EasyNTPClient::setTimeOffset (int offset) { this->mOffset = offset; this->mServerTime = this->mServerTime + this->mOffset; }

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

No branches or pull requests

1 participant