@CalendarType(value="iso8601") public class GregorianTimezoneRule extends DaylightSavingRule implements java.io.Serializable
Represents a standard daylight saving rule following the gregorian calendar as used in IANA-TZDB.
| Modifier and Type | Method and Description |
|---|---|
PlainDate |
getDate(int year)
Determines the date of time switch dependent on given year.
|
Month |
getMonth()
Yields the gregorian month of time switch.
|
static GregorianTimezoneRule |
ofFixedDay(Month month,
int dayOfMonth,
PlainTime timeOfDay,
OffsetIndicator indicator,
int savings)
Creates a rule for a fixed day in given month.
|
static GregorianTimezoneRule |
ofLastWeekday(Month month,
Weekday dayOfWeek,
PlainTime timeOfDay,
OffsetIndicator indicator,
int savings)
Creates a rule for the last day of week in given month.
|
static GregorianTimezoneRule |
ofWeekdayAfterDate(Month month,
int dayOfMonth,
Weekday dayOfWeek,
PlainTime timeOfDay,
OffsetIndicator indicator,
int savings)
Creates a rule for a day of week after the given reference date.
|
static GregorianTimezoneRule |
ofWeekdayBeforeDate(Month month,
int dayOfMonth,
Weekday dayOfWeek,
PlainTime timeOfDay,
OffsetIndicator indicator,
int savings)
Creates a rule for a day of week before the given reference date.
|
getIndicator, getSavings, getTimeOfDaypublic static GregorianTimezoneRule ofFixedDay(Month month, int dayOfMonth, PlainTime timeOfDay, OffsetIndicator indicator, int savings)
Creates a rule for a fixed day in given month.
month - calendar monthdayOfMonth - day of month (1 - 31)timeOfDay - clock time when time switch happensindicator - offset indicatorsavings - fixed DST-offset in secondsjava.lang.IllegalArgumentException - if the last argument is negative or
if the day of month is not valid in context of given monthpublic static GregorianTimezoneRule ofLastWeekday(Month month, Weekday dayOfWeek, PlainTime timeOfDay, OffsetIndicator indicator, int savings)
Creates a rule for the last day of week in given month.
month - calendar monthdayOfWeek - last day of weektimeOfDay - clock time when time switch happensindicator - offset indicatorsavings - fixed DST-offset in secondsjava.lang.IllegalArgumentException - if the last argument is negativepublic static GregorianTimezoneRule ofWeekdayAfterDate(Month month, int dayOfMonth, Weekday dayOfWeek, PlainTime timeOfDay, OffsetIndicator indicator, int savings)
Creates a rule for a day of week after the given reference date.
Example => You have to set for the second Sunday in April:
month=APRIL, dayOfMonth=8, dayOfWeek=SUNDAY.
month - calendar monthdayOfMonth - reference day of month (1 - 31)dayOfWeek - day of week when time switch happenstimeOfDay - clock time when time switch happensindicator - offset indicatorsavings - fixed DST-offset in secondsjava.lang.IllegalArgumentException - if the last argument is negative or
if the day of month is not valid in context of given monthpublic static GregorianTimezoneRule ofWeekdayBeforeDate(Month month, int dayOfMonth, Weekday dayOfWeek, PlainTime timeOfDay, OffsetIndicator indicator, int savings)
Creates a rule for a day of week before the given reference date.
month - calendar monthdayOfMonth - reference day of month (1 - 31)dayOfWeek - day of week when time switch happenstimeOfDay - clock time when time switch happensindicator - offset indicatorsavings - fixed DST-offset in secondsjava.lang.IllegalArgumentException - if the last argument is negative or
if the day of month is not valid in context of given monthpublic PlainDate getDate(int year)
DaylightSavingRuleDetermines the date of time switch dependent on given year.
The result must be interpreted by mean of DaylightSavingRule.getIndicator()
in order to calculate the UTC date.
getDate in class DaylightSavingRuleyear - reference year when a time switch happenspublic Month getMonth()
Yields the gregorian month of time switch.