Package com.day.util
Class TimeZoneUtil
- java.lang.Object
-
- com.day.util.TimeZoneUtil
-
public class TimeZoneUtil extends java.lang.Object
TheTimeZoneUtil
class provides convenience methods for handling time zones in Java.- Since:
- echidna Audience wad
-
-
Constructor Summary
Constructors Constructor Description TimeZoneUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.TimeZone[]
getAvailableZones()
Returns an array ofTimeZone
objects sorted in ascending order by their UTC time offset.static java.lang.String
getDisplayName(java.util.TimeZone zone)
Formats the passedTimeZone
object to a String representation:static java.util.TimeZone
getServerTimeZone()
Returns theTimeZone
of the Communique server.
-
-
-
Method Detail
-
getAvailableZones
public static java.util.TimeZone[] getAvailableZones()
Returns an array ofTimeZone
objects sorted in ascending order by their UTC time offset.- Returns:
- a sorted array of
TimeZone
objects.
-
getServerTimeZone
public static java.util.TimeZone getServerTimeZone()
Returns theTimeZone
of the Communique server.- Returns:
- the
TimeZone
of the Communique server.
-
getDisplayName
public static java.lang.String getDisplayName(java.util.TimeZone zone)
Formats the passedTimeZone
object to a String representation:[<UTC offset>] <time zone name> (<short name>)
Example: [UTC+01.00] Europe/Berlin (CEST)
- Parameters:
zone
- TheTimeZone
to format- Returns:
- a
String
representation of the passedTimeZone
.
-
-