-
Notifications
You must be signed in to change notification settings - Fork 385
Labels
conclusion: duplicateHas already been submittedHas already been submittedtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: enhancementProposed improvementProposed improvement
Description
I've adjusted getFormattedTime() to take an (optional) 'secs' argument, so that the same formatting code can be used to format any given time, while still formatting the NTP time if the argument is left out. This is similar to time conversion functions in other languages, and might avoid the need to include a dedicated time/date library in some projects.
NTPClient.h:
/**
* @return secs argument (or 0 for current time) formatted like `hh:mm:ss`
*/
String getFormattedTime(unsigned long secs = 0);
NTPClient.cpp:
String NTPClient::getFormattedTime(unsigned long secs) {
unsigned long rawTime = secs ? secs : this->getEpochTime();
Metadata
Metadata
Assignees
Labels
conclusion: duplicateHas already been submittedHas already been submittedtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: enhancementProposed improvementProposed improvement