AceTime
1.7.3
Date and time classes for Arduino that support timezones from the TZ Database, and a system clock that can synchronize from an NTP server or an RTC chip.
|
8 #include "common/DateStrings.h"
9 #include "TimeOffset.h"
11 using ace_common::printPad2To;
27 printPad2To(printer, hour,
'0');
29 printPad2To(printer, minute,
'0');
34 if (strlen(offsetString) != kTimeOffsetStringLength) {
42 const char* s = offsetString;
46 if (utcSign !=
'-' && utcSign !=
'+') {
51 uint8_t hour = (*s++ -
'0');
52 hour = 10 * hour + (*s++ -
'0');
56 uint8_t minute = (*s++ -
'0');
57 minute = 10 * minute + (*s++ -
'0');
static TimeOffset forError()
Return an error indicator.
static TimeOffset forOffsetStringChainable(const char *&offsetString)
Variant of forOffsetString() that updates the string pointer to the next unprocessed character.
static TimeOffset forOffsetString(const char *offsetString)
Create from an offset string ("-07:00" or "+01:00").
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.
static TimeOffset forHourMinute(int8_t hour, int8_t minute)
Create TimeOffset from (hour, minute) offset.
void toHourMinute(int8_t &hour, int8_t &minute) const
Extract hour and minute representation of the offset.