6 #include "common/util.h" 11 using common::printPad2;
15 printer.print(F(
"<Invalid LocalTime>"));
20 printPad2(printer, mHour);
22 printPad2(printer, mMinute);
24 printPad2(printer, mSecond);
28 if (strlen(timeString) < kTimeStringLength) {
36 const char* s = timeString;
39 uint8_t
hour = (*s++ -
'0');
40 hour = 10 * hour + (*s++ -
'0');
46 uint8_t
minute = (*s++ -
'0');
47 minute = 10 * minute + (*s++ -
'0');
53 uint8_t
second = (*s++ -
'0');
54 second = 10 * second + (*s++ -
'0');
void printTo(Print &printer) const
Print LocalTime to 'printer' in ISO 8601 format.
The time (hour, minute, second) fields representing the time without regards to the day or the time z...
static LocalTime forTimeStringChainable(const char *&timeString)
Variant of forTimeString() that updates the pointer to the next unprocessed character.
bool isError() const
Return true if any component is outside the normal time range of 00:00:00 to 23:59:59.
static LocalTime forError()
Factory method that returns an instance which indicates an error condition.
uint8_t hour() const
Return the hour.
static LocalTime forTimeString(const char *timeString)
Factory method.
uint8_t minute() const
Return the minute.
uint8_t second() const
Return the second.
LocalTime()
Default constructor does nothing.