Package com.day.util
Class TimeZoneUtil
- java.lang.Object
-
- com.day.util.TimeZoneUtil
-
public class TimeZoneUtil extends 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 TimeZone[]
getAvailableZones()
Returns an array ofTimeZone
objects sorted in ascending order by their UTC time offset.static String
getDisplayName(TimeZone zone)
Formats the passedTimeZone
object to a String representation:static TimeZone
getServerTimeZone()
Returns theTimeZone
of the Communique server.
-
-
-
Method Detail
-
getAvailableZones
public static 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 TimeZone getServerTimeZone()
Returns theTimeZone
of the Communique server.- Returns:
- the
TimeZone
of the Communique server.
-
getDisplayName
public static String getDisplayName(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
.
-
-