Skip to content

Commit 708e8a7

Browse files
committed
Added review comments.
1 parent 6865830 commit 708e8a7

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

NTPClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ DateTime NTPClient::getDateTime() const {
153153
return dt;
154154
}
155155

156-
String NTPClient::formatDateTime(const char* fmt) const {
156+
String NTPClient::getFormattedDateTime(const char* dateTimeFormat) const {
157157
struct tm * ts;
158158
time_t rawTime = this->getEpochTime();
159159
ts = localtime(&rawTime);
160160
char buf[64];
161-
strftime(buf, sizeof(buf), fmt, ts);
161+
strftime(buf, sizeof(buf), dateTimeFormat, ts);
162162
return String(buf);
163163
}
164164

NTPClient.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ class NTPClient {
8585
int getSeconds() const;
8686

8787
/**
88-
* Get date time as a astuct which contains
88+
* Get date time as a struct which contains
8989
* Year, Month, Date, Hours, Minutes, Seconds
9090
*/
9191
DateTime getDateTime() const;
9292

9393
/**
94-
* Format the date time to a string with a given format (Ex: %Y/%m/%d %H:%M:%S)
94+
* Return the date time as a String with the given format (Ex: %Y/%m/%d %H:%M:%S)
9595
*/
96-
String formatDateTime(const char* fmt) const;
96+
String getFormattedDateTime(const char* dateTimeFormat) const;
9797

9898
/**
9999
* Changes the time offset. Useful for changing timezones dynamically

keywords.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ getEpochTime KEYWORD2
2121
setTimeOffset KEYWORD2
2222
setUpdateInterval KEYWORD2
2323
setPoolServerName KEYWORD2
24+
getDateTime KEYWORD2
25+
getFormattedDateTime KEYWORD2

0 commit comments

Comments
 (0)