Package com.timeanddate.services
Class DSTService
java.lang.Object
com.timeanddate.services.BaseService
com.timeanddate.services.DSTService
- Author:
- Cato Auestad <cato@timeanddate.com>
-
Field Summary
Fields inherited from class com.timeanddate.services.BaseService
Language, ServiceName, Version
-
Constructor Summary
ConstructorsConstructorDescriptionDSTService(String accessKey, String secretKey)
The dstlist service can be used to obtain data about timezones in all supported countries, eventual start and end date of daylight savings time, and UTC offset for the timezones. -
Method Summary
Modifier and TypeMethodDescriptionGets the all entries with daylight saving timegetDaylightSavingTime(int year)
Gets the daylight saving time by year.getDaylightSavingTime(String countryCode)
Gets the daylight saving time by ISO3166-1-alpha-2 Country CodegetDaylightSavingTime(String countryCode, int year)
Gets the daylight saving time by country and year.boolean
boolean
boolean
void
setIncludeOnlyDstCountries(boolean bool)
void
setIncludePlacesForEveryCountry(boolean bool)
void
setIncludeTimeChanges(boolean bool)
-
Constructor Details
-
DSTService
The dstlist service can be used to obtain data about timezones in all supported countries, eventual start and end date of daylight savings time, and UTC offset for the timezones.The result data is aggregated on country/timezone level. By default, only information from countries that actually observe DST is returned without listing the individually affected locations – see the parameters listplaces and onlydst to change this behavior.
- Parameters:
accessKey
- Access key.secretKey
- Secret key.- Throws:
AuthenticationException
- Encryption of the authentication failed
-
-
Method Details
-
getDaylightSavingTime
Gets the all entries with daylight saving time- Returns:
- The daylight saving time.
- Throws:
ServerSideException
- The server produced an error messageIllegalArgumentException
- A required argument was not as expected
-
getDaylightSavingTime
public List<DST> getDaylightSavingTime(String countryCode) throws IllegalArgumentException, ServerSideExceptionGets the daylight saving time by ISO3166-1-alpha-2 Country Code- Parameters:
countryCode
-- Returns:
- The daylight saving time.
- Throws:
ServerSideException
- The server produced an error messageIllegalArgumentException
- A required argument was not as expected
-
getDaylightSavingTime
public List<DST> getDaylightSavingTime(int year) throws IllegalArgumentException, ServerSideExceptionGets the daylight saving time by year.- Parameters:
year
- Year- Returns:
- The daylight saving time.
- Throws:
ServerSideException
- The server produced an error messageIllegalArgumentException
- A required argument was not as expected
-
getDaylightSavingTime
Gets the daylight saving time by country and year.- Parameters:
countryCode
- ISO3166-1-alpha-2 Country Codeyear
- Year.- Returns:
- The daylight saving time.
- Throws:
ServerSideException
- The server produced an error messageIllegalArgumentException
- A required argument was not as expected
-
setIncludePlacesForEveryCountry
public void setIncludePlacesForEveryCountry(boolean bool) -
getIncludePlacesForEveryCountry
public boolean getIncludePlacesForEveryCountry() -
setIncludeOnlyDstCountries
public void setIncludeOnlyDstCountries(boolean bool) -
getIncludeOnlyDstCountries
public boolean getIncludeOnlyDstCountries() -
setIncludeTimeChanges
public void setIncludeTimeChanges(boolean bool) -
getIncludeTimeChanges
public boolean getIncludeTimeChanges()
-