1 #ifndef ACE_TIME_TIME_ZONE_H 2 #define ACE_TIME_TIME_ZONE_H 5 #include "TimeOffset.h" 6 #include "ZoneSpecifier.h" 7 #include "ManualZoneSpecifier.h" 98 static const uint8_t kTypeFixed = 0;
135 return (mType == kTypeFixed)
146 return (mType == kTypeFixed)
172 void printTo(Print& printer)
const;
181 void printAbbrevTo(Print& printer, acetime_t epochSeconds)
const;
192 if (mType != kTypeManual)
return false;
203 if (mType != kTypeManual)
return;
235 mType(zoneSpecifier->
getType()),
251 if (a.
getType() == TimeZone::kTypeFixed) {
virtual OffsetDateTime getOffsetDateTime(const LocalDateTime &ldt) const =0
Return the best estimate of the OffsetDateTime at the given LocalDateTime for the timezone of the cur...
uint8_t getType() const
Return the kTypeXxx of the current instance.
static OffsetDateTime forLocalDateTimeAndOffset(const LocalDateTime &localDateTime, TimeOffset timeOffset)
Factory method from LocalDateTime and TimeOffset.
const ZoneSpecifier * mZoneSpecifier
Used if mType == mTypeZoneSpecifier.
static const uint8_t kTypeBasic
Indicate BasicZoneSpecifier.
bool isDst() const
Return the isDst() value of the underlying ManualZoneSpecifier.
virtual TimeOffset getDeltaOffset(acetime_t epochSeconds) const =0
Return the DST delta offset at epochSeconds.
An implementation of ZoneSpecifier which allows the user to manually adjust the UTC offset and the DS...
OffsetDateTime getOffsetDateTime(const LocalDateTime &ldt) const
Return the best estimate of the OffsetDateTime at the given LocalDateTime for the current TimeZone...
Base interface for ZoneSpecifier classes.
void printTo(Print &printer) const
Print the human readable representation of the time zone.
TimeZone()
Default constructor.
static TimeZone forZoneSpecifier(const ZoneSpecifier *zoneSpecifier)
Factory method to create from a ZoneSpecifier.
static const uint8_t kTypeExtended
Indicate ExtendedZoneSpecifier.
static TimeZone forTimeOffset(TimeOffset offset)
Factory method to create from a fixed UTC offset.
The date (year, month, day) and time (hour, minute, second) fields representing the time with an offs...
static const uint8_t kTypeManual
Indicate ManualZoneSpecifier.
A thin wrapper that represents a time offset from a reference point, usually 00:00 at UTC...
TimeOffset mOffset
Used if mType == mTypeFixed.
Class that describes a time zone.
uint8_t getType() const
Return the type of TimeZone.
void printAbbrevTo(Print &printer, acetime_t epochSeconds) const
Print the time zone abbreviation for the given epochSeconds.
virtual TimeOffset getUtcOffset(acetime_t epochSeconds) const =0
Return the total UTC offset at epochSeconds, including DST offset.
void isDst(bool dst)
Sets the isDst() flag of the underlying ManualZoneSpecifier.
TimeOffset getUtcOffset(acetime_t epochSeconds) const
Return the total UTC offset at epochSeconds, including DST offset.
TimeOffset getDeltaOffset(acetime_t epochSeconds) const
Return the DST offset from standard UTC offset at epochSeconds.