Class TimeService

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

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

    • TimeService

      public TimeService(String accessKey, String secretKey) throws AuthenticationException
      The timeservice service can be used to retrieve the current time in one or more places. Additionally, information about time zones and related changes and the time of sunrise and sunset can be queried.
      Parameters:
      accessKey - Access key.
      secretKey - Secret key.
      Throws:
      AuthenticationException - Encryption of the authentication failed
  • Method Details

    • currentTimeForPlace

      public List<Location> currentTimeForPlace(LocationId placeId) throws IllegalArgumentException, ServerSideException
      Retrieves the current time for place by ID.
      Parameters:
      placeId - Place identifier.
      Returns:
      The current time for place.
      Throws:
      ServerSideException - The server produced an error message
      IllegalArgumentException - A required argument was not as expected
    • setIncludeCoordinates

      public void setIncludeCoordinates(boolean bool)
    • getIncludeCoordinates

      public boolean getIncludeCoordinates()
    • setRadius

      public void setRadius(int radius)
    • getRadius

      public int getRadius()
    • setIncludeSunriseAndSunset

      public void setIncludeSunriseAndSunset(boolean bool)
    • getIncludeSunriseAndSunset

      public boolean getIncludeSunriseAndSunset()
    • setIncludeCurrentTimeToLocation

      public void setIncludeCurrentTimeToLocation(boolean bool)
    • getIncludeCurrentTimeToLocation

      public boolean getIncludeCurrentTimeToLocation()
    • setIncludeListOfTimeChanges

      public void setIncludeListOfTimeChanges(boolean bool)
    • getIncludeListOfTimeChanges

      public boolean getIncludeListOfTimeChanges()