46 size_t strftime(
char *buffer,
size_t buffer_len,
const char *format);
58 std::string
strftime(
const std::string &format);
65 return this->second < 61 && this->minute < 60 && this->hour < 24 && this->day_of_week > 0 &&
66 this->day_of_week < 8 && this->day_of_month > 0 && this->day_of_month < 32 && this->day_of_year > 0 &&
67 this->day_of_year < 367 && this->month > 0 && this->month < 13;
75 static bool strptime(
const std::string &time_to_parse,
ESPTime &esp_time);
86 struct tm *c_tm = ::localtime(&epoch);
95 struct tm *c_tm = ::gmtime(&epoch);
static ESPTime from_epoch_utc(time_t epoch)
Convert an UTC epoch timestamp to a UTC time ESPTime instance.
size_t strftime(char *buffer, size_t buffer_len, const char *format)
Convert this ESPTime struct to a null-terminated c string buffer as specified by the format argument...
static int32_t timezone_offset()
A more user-friendly version of struct tm from time.h.
static ESPTime from_c_tm(struct tm *c_tm, time_t c_time)
Convert a C tm struct instance with a C unix epoch timestamp to an ESPTime instance.
bool is_dst
daylight saving time flag
void increment_day()
Increment this clock instance by one day.
uint16_t day_of_year
day of the year [1-366]
bool operator<=(ESPTime other)
void increment_second()
Increment this clock instance by one second.
uint8_t days_in_month(uint8_t month, uint16_t year)
static ESPTime from_epoch_local(time_t epoch)
Convert an UTC epoch timestamp to a local time ESPTime instance.
bool operator>(ESPTime other)
bool increment_time_value(T ¤t, uint16_t begin, uint16_t end)
uint8_t second
seconds after the minute [0-60]
time_t timestamp
unix epoch time (seconds since UTC Midnight January 1, 1970)
uint8_t minute
minutes after the hour [0-59]
bool operator==(ESPTime other)
bool is_valid() const
Check if this ESPTime is valid (all fields in range and year is greater than 2018) ...
uint8_t day_of_week
day of the week; sunday=1 [1-7]
bool is_leap_year(uint32_t year)
void recalc_timestamp_local(bool use_day_of_year=true)
Recalculate the timestamp field from the other fields of this ESPTime instance assuming local fields...
Implementation of SPI Controller mode.
void recalc_timestamp_utc(bool use_day_of_year=true)
Recalculate the timestamp field from the other fields of this ESPTime instance (must be UTC)...
uint8_t month
month; january=1 [1-12]
uint8_t hour
hours since midnight [0-23]
bool operator<(ESPTime other)
uint8_t day_of_month
day of the month [1-31]
bool operator>=(ESPTime other)
bool fields_in_range() const
Check if all time fields of this ESPTime are in range.
static bool strptime(const std::string &time_to_parse, ESPTime &esp_time)
Convert a string to ESPTime struct as specified by the format argument.