Class Overview
A class containing utility methods related to time zones.
Summary
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.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Public Methods
public
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.
Returns null if no suitable zone could be found.
public
static
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.