8 #include "LocalDateTime.h"
9 #include "OffsetDateTime.h"
10 #include "TimeOffset.h"
16 printer.print(F(
"<Invalid OffsetDateTime>"));
21 mLocalDateTime.
printTo(printer);
28 if (strlen(dateString) < kDateStringLength) {
35 const __FlashStringHelper* dateString) {
39 char buffer[kDateStringLength + 2];
40 strncpy_P(buffer, (
const char*) dateString,
sizeof(buffer));
41 buffer[kDateStringLength + 1] = 0;
44 size_t len = strlen(buffer);
45 if (len > kDateStringLength) {
53 const char* s = dateString;
Class that holds the date-time as the components (year, month, day, hour, minute, second) without reg...
void printTo(Print &printer) const
Print LocalDateTime to 'printer' in ISO 8601 format.
static LocalDateTime forDateStringChainable(const char *&dateString)
Variant of forDateString() that updates the pointer to the next unprocessed character.
The date (year, month, day), time (hour, minute, second) and fixed offset from UTC (timeOffset).
static OffsetDateTime forDateStringChainable(const char *&dateString)
Variant of forDateString() that updates the pointer to the next unprocessed character.
bool isError() const
Return true if any component indicates an error condition.
OffsetDateTime()
Constructor.
void printTo(Print &printer) const
Print OffsetDateTime to 'printer' in ISO 8601 format.
static OffsetDateTime forError()
Factory method that returns an instance whose isError() is true.
static OffsetDateTime forDateString(const char *dateString)
Factory method.
A thin wrapper that represents a time offset from a reference point, usually 00:00 at UTC,...
void printTo(Print &printer) const
Print the human readable string, including a "-" or "+" prefix, in the form of "+/-hh:mm" or "+/-hh:m...
static TimeOffset forOffsetStringChainable(const char *&offsetString)
Variant of forOffsetString() that updates the string pointer to the next unprocessed character.