Class DSTService

java.lang.Object
com.timeanddate.services.BaseService
com.timeanddate.services.DSTService

public class DSTService extends BaseService
Author:
Cato Auestad <cato@timeanddate.com>
  • Constructor Details

    • DSTService

      public DSTService(String accessKey, String secretKey) throws AuthenticationException
      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

      public List<DST> getDaylightSavingTime() throws IllegalArgumentException, ServerSideException
      Gets the all entries with daylight saving time
      Returns:
      The daylight saving time.
      Throws:
      ServerSideException - The server produced an error message
      IllegalArgumentException - A required argument was not as expected
    • getDaylightSavingTime

      public List<DST> getDaylightSavingTime(String countryCode) throws IllegalArgumentException, ServerSideException
      Gets 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 message
      IllegalArgumentException - A required argument was not as expected
    • getDaylightSavingTime

      public List<DST> getDaylightSavingTime(int year) throws IllegalArgumentException, ServerSideException
      Gets the daylight saving time by year.
      Parameters:
      year - Year
      Returns:
      The daylight saving time.
      Throws:
      ServerSideException - The server produced an error message
      IllegalArgumentException - A required argument was not as expected
    • getDaylightSavingTime

      public List<DST> getDaylightSavingTime(String countryCode, int year) throws ServerSideException
      Gets the daylight saving time by country and year.
      Parameters:
      countryCode - ISO3166-1-alpha-2 Country Code
      year - Year.
      Returns:
      The daylight saving time.
      Throws:
      ServerSideException - The server produced an error message
      IllegalArgumentException - 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()