Added review comments.
This commit is contained in:
parent
68658309b1
commit
708e8a7983
@ -153,12 +153,12 @@ DateTime NTPClient::getDateTime() const {
|
||||
return dt;
|
||||
}
|
||||
|
||||
String NTPClient::formatDateTime(const char* fmt) const {
|
||||
String NTPClient::getFormattedDateTime(const char* dateTimeFormat) const {
|
||||
struct tm * ts;
|
||||
time_t rawTime = this->getEpochTime();
|
||||
ts = localtime(&rawTime);
|
||||
char buf[64];
|
||||
strftime(buf, sizeof(buf), fmt, ts);
|
||||
strftime(buf, sizeof(buf), dateTimeFormat, ts);
|
||||
return String(buf);
|
||||
}
|
||||
|
||||
|
@ -85,15 +85,15 @@ class NTPClient {
|
||||
int getSeconds() const;
|
||||
|
||||
/**
|
||||
* Get date time as a astuct which contains
|
||||
* Get date time as a struct which contains
|
||||
* Year, Month, Date, Hours, Minutes, Seconds
|
||||
*/
|
||||
DateTime getDateTime() const;
|
||||
|
||||
/**
|
||||
* Format the date time to a string with a given format (Ex: %Y/%m/%d %H:%M:%S)
|
||||
* Return the date time as a String with the given format (Ex: %Y/%m/%d %H:%M:%S)
|
||||
*/
|
||||
String formatDateTime(const char* fmt) const;
|
||||
String getFormattedDateTime(const char* dateTimeFormat) const;
|
||||
|
||||
/**
|
||||
* Changes the time offset. Useful for changing timezones dynamically
|
||||
|
@ -21,3 +21,5 @@ getEpochTime KEYWORD2
|
||||
setTimeOffset KEYWORD2
|
||||
setUpdateInterval KEYWORD2
|
||||
setPoolServerName KEYWORD2
|
||||
getDateTime KEYWORD2
|
||||
getFormattedDateTime KEYWORD2
|
||||
|
Loading…
Reference in New Issue
Block a user