7#include "nlohmann/json.hpp"
36 }
else if (sscanf(hhmm,
"%2hhu:%2hhu", &t.
hour, &t.
minute) == 2) {
51 snprintf(buf,
sizeof(buf),
"%02u:%02u:%02u", time.
hour, time.
minute, time.
second);
53 snprintf(buf,
sizeof(buf),
"%02u:%02u", time.
hour, time.
minute);
55 return std::string(buf);
65 return !(*
this == other);
75 return !(*
this > other);
83 return !(*
this < other);
A simple value type representing a time of day (hour, minute, second).
bool operator>=(const TimeOfDay &other) const
static TimeOfDay fromString(const char *hhmm)
Parse a string in the form "HH:MM" or "HH:MM:SS".
bool operator==(const TimeOfDay &other) const
bool operator<=(const TimeOfDay &other) const
bool operator!=(const TimeOfDay &other) const
bool operator<(const TimeOfDay &other) const
static std::string toString(const TimeOfDay &time)
Format the time as a string.
bool operator>(const TimeOfDay &other) const