Package com.timeanddate.services
Class ConvertTimeService
java.lang.Object
com.timeanddate.services.BaseService
com.timeanddate.services.ConvertTimeService
- Author:
- Cato Auestad <cato@timeanddate.com>
-
Field Summary
Fields inherited from class com.timeanddate.services.BaseService
Language, ServiceName, Version
-
Constructor Summary
ConstructorsConstructorDescriptionConvertTimeService(String accessKey, String secretKey)
The converttime service can be used to convert any time from UTC or any of the supported locations to any other of the supported locations. -
Method Summary
Modifier and TypeMethodDescriptionconvertTime(LocationId fromId, TADDateTime date)
Converts the time by using a LocationId and a Calendar to convert to.convertTime(LocationId fromId, TADDateTime date, List<LocationId> toIds)
Converts the time by using a LocationId, a Calendar and a list of IDs to convert to.convertTime(LocationId fromId, String iso)
convertTime(LocationId fromId, String iso, List<LocationId> toIds)
Converts the time by using a LocationId, a ISO-string and a list of IDs to convert to.convertTime(LocationId fromId, Calendar date)
Converts the time by using a LocationId and a Calendar to convert to.convertTime(LocationId fromId, Calendar date, List<LocationId> toIds)
Converts the time by using a LocationId, a Calendar and a list of IDs to convert to.boolean
boolean
int
void
setIncludeTimeChanges(boolean bool)
void
setIncludeTimezoneInformation(boolean bool)
void
setRadius(int radius)
-
Constructor Details
-
ConvertTimeService
The converttime service can be used to convert any time from UTC or any of the supported locations to any other of the supported locations.- Parameters:
accessKey
- Access key.secretKey
- Secret key.- Throws:
AuthenticationException
- Encryption of the authentication failed
-
-
Method Details
-
convertTime
public ConvertedTimes convertTime(LocationId fromId, String iso, List<LocationId> toIds) throws IllegalArgumentException, ServerSideExceptionConverts the time by using a LocationId, a ISO-string and a list of IDs to convert to.- Parameters:
fromId
- The places identifieriso
- ISO 8601-formatted string.toIds
- The place IDs to convert to.- Returns:
- The converted time.
- Throws:
ServerSideException
- The server produced an error messageIllegalArgumentException
- A required argument was not as expected
-
convertTime
public ConvertedTimes convertTime(LocationId fromId, String iso) throws IllegalArgumentException, ServerSideException- Parameters:
fromId
- The places identifieriso
- ISO 8601-formatted string.- Returns:
- The converted time.
- Throws:
ServerSideException
- The server produced an error messageIllegalArgumentException
- A required argument was not as expected
-
convertTime
public ConvertedTimes convertTime(LocationId fromId, Calendar date, List<LocationId> toIds) throws IllegalArgumentException, ServerSideExceptionConverts the time by using a LocationId, a Calendar and a list of IDs to convert to.- Parameters:
fromId
- The places identifierdate
- Date.toIds
- The place IDs to convert to.- Returns:
- The converted time.
- Throws:
ServerSideException
- The server produced an error messageIllegalArgumentException
- A required argument was not as expected
-
convertTime
public ConvertedTimes convertTime(LocationId fromId, TADDateTime date, List<LocationId> toIds) throws IllegalArgumentException, ServerSideExceptionConverts the time by using a LocationId, a Calendar and a list of IDs to convert to.- Parameters:
fromId
- The places identifierdate
- Date.toIds
- The place IDs to convert to.- Returns:
- The converted time.
- Throws:
ServerSideException
- The server produced an error messageIllegalArgumentException
- A required argument was not as expected
-
convertTime
public ConvertedTimes convertTime(LocationId fromId, Calendar date) throws IllegalArgumentException, ServerSideExceptionConverts the time by using a LocationId and a Calendar to convert to.- Parameters:
fromId
- The places identifierdate
- Date.- Returns:
- The converted time.
- Throws:
ServerSideException
- The server produced an error messageIllegalArgumentException
- A required argument was not as expected
-
convertTime
public ConvertedTimes convertTime(LocationId fromId, TADDateTime date) throws IllegalArgumentException, ServerSideExceptionConverts the time by using a LocationId and a Calendar to convert to.- Parameters:
fromId
- The places identifierdate
- Date.- Returns:
- The converted time.
- Throws:
ServerSideException
- The server produced an error messageIllegalArgumentException
- A required argument was not as expected
-
setRadius
public void setRadius(int radius) -
getRadius
public int getRadius() -
setIncludeTimeChanges
public void setIncludeTimeChanges(boolean bool) -
getIncludeTimeChanges
public boolean getIncludeTimeChanges() -
setIncludeTimezoneInformation
public void setIncludeTimezoneInformation(boolean bool) -
getIncludeTimezoneInformation
public boolean getIncludeTimezoneInformation()
-