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" 52 static const uint8_t kTypeFixed = 0;
53 static const uint8_t kTypeZoneSpecifier = 1;
84 return (mType == kTypeFixed)
95 return (mType == kTypeFixed)
106 return (mType == kTypeFixed)
112 void printTo(Print& printer)
const;
115 void printAbbrevTo(Print& printer, acetime_t epochSeconds)
const;
126 if (mType != kTypeZoneSpecifier)
return false;
138 if (mType != kTypeZoneSpecifier)
return;
171 mType(kTypeZoneSpecifier),
187 if (a.
getType() == TimeZone::kTypeFixed) {
bool isDst() const
Return the isDst() value of the underlying ManualZoneSpecifier.
const ZoneSpecifier * mZoneSpecifier
Used if mType == mTypeZoneSpecifier.
TimeOffset getUtcOffset(acetime_t epochSeconds) const
Return the total UTC offset at epochSeconds, including DST offset.
uint8_t getType() const
Return the type of TimeZone.
static TimeZone forTimeOffset(TimeOffset offset=TimeOffset())
Factory method to create from a fixed UTC offset.
void printAbbrevTo(Print &printer, acetime_t epochSeconds) const
Print the time zone abbreviation for the given epochSeconds.
virtual TimeOffset getUtcOffsetForDateTime(const LocalDateTime &ldt) const =0
Return the UTC offset matching the given the date/time components.
TimeOffset getUtcOffsetForDateTime(const LocalDateTime &ldt) const
Return the best guess of the UTC offset at the given LocalDateTime for the current TimeZone...
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...
Base interface for ZoneSpecifier classes.
TimeZone()
Default constructor.
static TimeZone forZoneSpecifier(const ZoneSpecifier *zoneSpecifier)
Factory method to create from a ZoneSpecifier.
uint8_t getType() const
Return the kTypeXxx of the current instance.
void printTo(Print &printer) const
Print the human readable representation of the time zone.
TimeOffset getDeltaOffset(acetime_t epochSeconds) const
Return the DST offset from standard UTC offset at epochSeconds.
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.
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.