AceTime 2.4.0 Date and time classes for Arduino that support timezones from the TZ Database.

ZonedDateTime.cpp
1 /*
2 * MIT License
3 * Copyright (c) 2018 Brian T. Park
4 */
5
6 #include "common/DateStrings.h"
7 #include "ZonedDateTime.h"
8
9 namespace ace_time {
10
11 // Print ZonedDateTime in ISO 8601 format
12 void ZonedDateTime::printTo(Print& printer) const {
13 if (isError()) {
14 printer.print(F("<Invalid ZonedDateTime>"));
15 return;
16 }
17
18 mOffsetDateTime.printTo(printer);
19 printer.print('[');
20 mTimeZone.printTo(printer);
21 printer.print(']');
22 }
23
24 }
ace_time::OffsetDateTime::printTo
void printTo(Print &printer) const
Print OffsetDateTime to 'printer' in ISO 8601 format.
Definition: OffsetDateTime.cpp:14
ace_time::TimeZone::printTo
void printTo(Print &printer) const
Print the text representation of the time zone using the full canonical time zone name or UTC offset ...
Definition: TimeZone.cpp:12
ace_time::ZonedDateTime::printTo
void printTo(Print &printer) const
Print ZonedDateTime to 'printer'.
Definition: ZonedDateTime.cpp:12
ace_time::ZonedDateTime::isError
bool isError() const
Return true if any component indicates an error condition.
Definition: ZonedDateTime.h:167