AceTime
1.11.2
Date and time classes for Arduino that support timezones from the TZ Database.
|
7 #include "common/DateStrings.h"
8 #include "LocalDateTime.h"
10 using ace_common::printPad2To;
16 printer.print(F(
"<Invalid LocalDateTime>"));
21 printer.print(mLocalDate.
year());
23 printPad2To(printer, mLocalDate.
month(),
'0');
25 printPad2To(printer, mLocalDate.
day(),
'0');
31 printPad2To(printer, mLocalTime.
hour(),
'0');
33 printPad2To(printer, mLocalTime.
minute(),
'0');
35 printPad2To(printer, mLocalTime.
second(),
'0');
39 if (strlen(dateString) < kDateTimeStringLength) {
47 const char* s = dateString;
static LocalTime forTimeStringChainable(const char *&timeString)
Variant of forTimeString() that updates the pointer to the next unprocessed character.
uint8_t month() const
Return the month with January=1, December=12.
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 forError()
Factory method that returns an instance where isError() returns true.
The date (year, month, day) representing the date without regards to time zone.
static LocalDate forDateStringChainable(const char *&dateString)
Variant of forDateString() 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.
uint8_t day() const
Return the day of the month.
bool isError() const
Return true if any component indicates an error condition.
int16_t year() const
Return the full year instead of just the last 2 digits.
LocalDateTime()
Constructor.
uint8_t hour() const
Return the hour.
uint8_t second() const
Return the second.
uint8_t minute() const
Return the minute.
static LocalDateTime forDateString(const char *dateString)
Factory method.
The time (hour, minute, second) fields representing the time without regards to the day or the time z...