1 #ifndef ACE_TIME_MANUAL_ZONE_SPECIFIER_H 2 #define ACE_TIME_MANUAL_ZONE_SPECIFIER_H 5 #include "TimeOffset.h" 6 #include "ZoneSpecifier.h" 64 bool isDst()
const {
return mIsDst; }
67 const char*
stdAbbrev()
const {
return mStdAbbrev; }
70 const char*
dstAbbrev()
const {
return mDstAbbrev; }
102 return mIsDst ? mDstAbbrev : mStdAbbrev;
110 void printTo(Print& printer)
const override;
117 return isDst() == that.isDst()
120 && strcmp(
stdAbbrev(), that.stdAbbrev()) == 0
121 && strcmp(
dstAbbrev(), that.dstAbbrev()) == 0;
131 const char* mStdAbbrev;
134 const char* mDstAbbrev;
TimeOffset getDeltaOffset(acetime_t) const override
Return the DST delta offset at epochSeconds.
OffsetDateTime getOffsetDateTime(const LocalDateTime &ldt) const override
Return the best estimate of the OffsetDateTime at the given LocalDateTime for the timezone of the cur...
ManualZoneSpecifier & operator=(const ManualZoneSpecifier &)=default
Default assignment operator.
static OffsetDateTime forLocalDateTimeAndOffset(const LocalDateTime &localDateTime, TimeOffset timeOffset)
Factory method from LocalDateTime and TimeOffset.
void isDst(bool isDst)
Set the current isDst flag.
static TimeOffset forHour(int8_t hour)
Create TimeOffset with the corresponding hour offset.
void printTo(Print &printer) const override
Print the zone specifier in the format of "+/-HH:MM (DST|STD)".
An implementation of ZoneSpecifier which allows the user to manually adjust the UTC offset and the DS...
Base interface for ZoneSpecifier classes.
const char * dstAbbrev() const
Get the DST abbreviation.
static TimeOffset forOffsetCode(int8_t offsetCode)
Create TimeOffset from the offset code.
The date (year, month, day) and time (hour, minute, second) fields representing the time with an offs...
static const uint8_t kTypeManual
Indicate ManualZoneSpecifier.
void stdOffset(TimeOffset offset)
Set the standard UTC offset.
A thin wrapper that represents a time offset from a reference point, usually 00:00 at UTC...
TimeOffset deltaOffset() const
Get the DST delta offset.
bool isDst() const
Get the current isDst flag.
ManualZoneSpecifier(TimeOffset stdOffset=TimeOffset(), bool isDst=false, const char *stdAbbrev="", const char *dstAbbrev="", TimeOffset deltaOffset=TimeOffset::forHour(1))
Constructor for a time zone with an offset from UTC that does not change with epochSeconds.
TimeOffset stdOffset() const
Get the standard UTC offset.
TimeOffset getUtcOffset(acetime_t) const override
Return the total UTC offset at epochSeconds, including DST offset.
int8_t toOffsetCode() const
Return the time offset as the number of 15 minute increments.
const char * stdAbbrev() const
Get the standard abbreviation.
const char * getAbbrev(acetime_t) const override
Return the time zone abbreviation at epochSeconds.