NTPClient
NTPClient copied to clipboard
Fix epoch time by removing user offset
getEpochTime()
should return epoch time that does not include offsets.
User offset is included in methods returning local times - getDay()
, getHours()
, getMinutes()
, getSeconds()
, getFormattedTime()
.
Fixes #35
Can this be merged? the epoch time is wrong as it currently is
Hi @petslane :wave:
As much as I agree with your point, if we do in fact merge it then it would break compatibility with everyone who is relying on getEpochTime
returning the unix epoch time + the set time offset. I'd propose a "softer" approach:
- Add 2 new methods which are in fact doing what their name advertises
unsigned long getUnixEpochTime() const; /* Returns the true unix epoch time without time offset */
unsigned long getUnixEpochTimeWithOffset() const { return getEpochTime(); }
- Mark
getEpochTime
asdeprecated
.
unsigned long getEpochTime() const __attribute__ ((deprecated));
- Release a new version and wait some time.
- Remove
getEpochTime()
.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
Peeter Normak seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.