diff --git a/esphome/core/time.cpp b/esphome/core/time.cpp index 9a1a0dc492..d30dac4394 100644 --- a/esphome/core/time.cpp +++ b/esphome/core/time.cpp @@ -46,7 +46,7 @@ struct tm ESPTime::to_c_tm() { return c_tm; } -std::string ESPTime::strftime(const char *format, size_t format_len) { +std::string ESPTime::strftime(const char *format) { struct tm c_tm = this->to_c_tm(); char buf[128]; size_t len = ::strftime(buf, sizeof(buf), format, &c_tm); @@ -56,7 +56,7 @@ std::string ESPTime::strftime(const char *format, size_t format_len) { return "ERROR"; } -std::string ESPTime::strftime(const std::string &format) { return this->strftime(format.c_str(), format.size()); } +std::string ESPTime::strftime(const std::string &format) { return this->strftime(format.c_str()); } bool ESPTime::strptime(const std::string &time_to_parse, ESPTime &esp_time) { uint16_t year; diff --git a/esphome/core/time.h b/esphome/core/time.h index 080a0793e0..ffcfced418 100644 --- a/esphome/core/time.h +++ b/esphome/core/time.h @@ -55,7 +55,7 @@ struct ESPTime { std::string strftime(const std::string &format); /// @copydoc strftime(const std::string &format) - std::string strftime(const char *format, size_t format_len = 0); + std::string strftime(const char *format); /// Check if this ESPTime is valid (all fields in range and year is greater than 2018) bool is_valid() const { return this->year >= 2019 && this->fields_in_range(); }