public
class
TimeUtils
extends Object
java.lang.Object | |
↳ | android.util.TimeUtils |
A class containing utility methods related to time zones.
Public methods | |
---|---|
static
TimeZone
|
getTimeZone(int offset, boolean dst, long when, String country)
Tries to return a time zone that would have had the specified offset and DST value at the specified moment in the specified country. |
static
String
|
getTimeZoneDatabaseVersion()
Returns a String indicating the version of the time zone database currently in use. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
TimeZone getTimeZone (int offset, boolean dst, long when, String country)
Tries to return a time zone that would have had the specified offset and DST value at the specified moment in the specified country. Returns null if no suitable zone could be found.
Parameters | |
---|---|
offset |
int
|
dst |
boolean
|
when |
long
|
country |
String
|
Returns | |
---|---|
TimeZone |
String getTimeZoneDatabaseVersion ()
Returns a String indicating the version of the time zone database currently in use. The format of the string is dependent on the underlying time zone database implementation, but will typically contain the year in which the database was updated plus a letter from a to z indicating changes made within that year.
Time zone database updates should be expected to occur periodically due to political and legal changes that cannot be anticipated in advance. Therefore, when computing the UTC time for a future event, applications should be aware that the results may differ following a time zone database update. This method allows applications to detect that a database change has occurred, and to recalculate any cached times accordingly.
The time zone database may be assumed to change only when the device runtime is restarted. Therefore, it is not necessary to re-query the database version during the lifetime of an activity.
Returns | |
---|---|
String |