6 #include "common/util.h" 7 #include "common/DateStrings.h" 8 #include "LocalDateTime.h" 12 using common::printPad2;
13 using common::DateStrings;
17 printer.print(F(
"<Invalid LocalDateTime>"));
22 printer.print(mLocalDate.
year());
24 printPad2(printer, mLocalDate.
month());
26 printPad2(printer, mLocalDate.
day());
32 printPad2(printer, mLocalTime.
hour());
34 printPad2(printer, mLocalTime.
minute());
36 printPad2(printer, mLocalTime.
second());
40 if (strlen(dateString) < kDateTimeStringLength) {
48 const char* s = dateString;
The time (hour, minute, second) fields representing the time without regards to the day or the time z...
void printTo(Print &printer) const
Print LocalDateTime to 'printer' in ISO 8601 format.
static LocalTime forTimeStringChainable(const char *&timeString)
Variant of forTimeString() that updates the pointer to the next unprocessed character.
static LocalDateTime forDateStringChainable(const char *&dateString)
Variant of forDateString() that updates the pointer to the next unprocessed character.
static LocalDate forDateStringChainable(const char *&dateString)
Variant of forDateString() that updates the pointer to the next unprocessed character.
uint8_t day() const
Return the day of the month.
static LocalDateTime forDateString(const char *dateString)
Factory method.
static LocalDateTime forError()
Factory method that returns an instance where isError() returns true.
uint8_t hour() const
Return the hour.
The date (year, month, day) representing the date without regards to time zone.
uint8_t minute() const
Return the minute.
uint8_t month() const
Return the month with January=1, December=12.
int16_t year() const
Return the full year instead of just the last 2 digits.
uint8_t second() const
Return the second.
LocalDateTime()
Constructor.
bool isError() const
Return true if any component indicates an error condition.
Class that holds the date-time as the components (year, month, day, hour, minute, second) without reg...