1 #include "common/util.h" 6 using common::printPad2;
10 printer.print(F(
"<Invalid LocalTime>"));
15 printPad2(printer, mHour);
17 printPad2(printer, mMinute);
19 printPad2(printer, mSecond);
23 if (strlen(timeString) < kTimeStringLength) {
26 return forTimeStringChainable(timeString);
30 LocalTime LocalTime::forTimeStringChainable(
const char*& timeString) {
31 const char* s = timeString;
34 uint8_t
hour = (*s++ -
'0');
35 hour = 10 * hour + (*s++ -
'0');
41 uint8_t
minute = (*s++ -
'0');
42 minute = 10 * minute + (*s++ -
'0');
48 uint8_t
second = (*s++ -
'0');
49 second = 10 * second + (*s++ -
'0');
The time (hour, minute, second) fields representing the time without regards to the day or the time z...
void printTo(Print &printer) const
Print LocalTime to 'printer' in ISO 8601 format.
static LocalTime forError()
Factory method that returns an instance which indicates an error condition.
static LocalTime forTimeString(const char *timeString)
Factory method.
uint8_t hour() const
Return the hour.
uint8_t second() const
Return the second.
bool isError() const
Return true if any component is outside the normal time range of 00:00:00 to 23:59:59.
uint8_t minute() const
Return the minute.
LocalTime()
Default constructor does nothing.