1 #include "common/util.h" 2 #include "common/DateStrings.h" 3 #include "LocalDateTime.h" 4 #include "OffsetDateTime.h" 8 using common::printPad2;
9 using common::DateStrings;
13 printer.print(F(
"<Invalid OffsetDateTime>"));
18 printer.print(mLocalDateTime.
year());
20 printPad2(printer, mLocalDateTime.
month());
22 printPad2(printer, mLocalDateTime.
day());
28 printPad2(printer, mLocalDateTime.
hour());
30 printPad2(printer, mLocalDateTime.
minute());
32 printPad2(printer, mLocalDateTime.
second());
40 printer.print(ds.weekDayLongString(
dayOfWeek()));
44 if (strlen(dateString) < kDateStringLength) {
47 return forDateStringChainable(dateString);
50 OffsetDateTime OffsetDateTime::forDateStringChainable(
const char*& dateString) {
51 const char* s = dateString;
54 TimeOffset offset = TimeOffset::forOffsetStringChainable(s);
uint8_t hour() const
Return the hour.
uint8_t month() const
Return the month with January=1, December=12.
uint8_t dayOfWeek() const
Return the day of the week, Monday=1, Sunday=7 (per ISO 8601).
uint8_t second() const
Return the second.
uint8_t minute() const
Return the minute.
OffsetDateTime()
Constructor.
int16_t year() const
Return the year.
uint8_t day() const
Return the day of the month.
The date (year, month, day) and time (hour, minute, second) fields representing the time with an offs...
bool isError() const
Return true if any component indicates an error condition.
A thin wrapper that represents a time offset from a reference point, usually 00:00 at UTC...
void printTo(Print &printer) const
Print OffsetDateTime to 'printer' in ISO 8601 format.
void printTo(Print &printer) const
Print the human readable string.
static OffsetDateTime forError()
Factory method that returns an instance whose isError() is true.
static OffsetDateTime forDateString(const char *dateString)
Factory method.