-
Notifications
You must be signed in to change notification settings - Fork 382
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
Add function getYears, getMonths, getDays #184
Conversation
Hello @per1234 , |
Hi @thaianhtaivn. Thanks for your pull request. My role in this project is somewhat janitorial in nature. I don't make the decisions about which pull requests are merged or not. I commented to provide some supplemental information that might be of use to the reviewers. Regards, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job. I'd suggest to add getFormattedDateTime
using new methods. Analogously to getFormattedTime
.
@@ -148,6 +148,27 @@ int NTPClient::getMinutes() const { | |||
int NTPClient::getSeconds() const { | |||
return (this->getEpochTime() % 60); | |||
} | |||
int NTPClient::getYears() const { | |||
time_t rawtime = this->getEpochTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use two spaces for indentation instead of four.
@@ -85,6 +85,9 @@ class NTPClient { | |||
int getHours() const; | |||
int getMinutes() const; | |||
int getSeconds() const; | |||
int getYears() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use two spaces for indentation instead of tab.
@thaianhtaivn Actually this was already implemented #94 but not merged :/ |
Already tested function with platformIO & ESP8266.