public final class DateTimeUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static List<String> |
SORTED_COMMON_TIMEZONES |
| Modifier and Type | Method and Description |
|---|---|
static TimeZone |
getActualTimeZone(TimeZone tz)
The entire time zone repository contains 500+ time zones.
|
static String |
getActualTimeZoneId(TimeZone addTimeZone)
Returns the id of the timezone passed
|
static List<javax.faces.model.SelectItem> |
getCommonTimeZoneSelectItems()
Returns a list of commonly used timezones, sorted by the timezone's raw
offset.
|
static List<javax.faces.model.SelectItem> |
getCommonTimeZoneSelectItems(Locale loc,
TimeZone addTimeZone)
Returns a list of commonly used timezones, sorted by the timezone's raw
offset.
|
static List<javax.faces.model.SelectItem> |
getCommonTimeZoneSelectItems(String timeZoneId)
Returns a list of commonly used timezones, sorted by the timezone's raw
offset.
|
static String |
getTimeZoneDisplayName(Locale loc,
String timezoneID) |
static List<String> |
getTimeZoneKeys(Locale loc,
List<String> timezones)
Returns a list of TimeZone ids for the timezones passed in.
|
static List<javax.faces.model.SelectItem> |
getTimeZoneSelectItems(Locale translationLocale,
TimeZone addTimeZone,
List<String> timezones)
Returns a list of SelectItems for the timezones passed in.
|
static List<javax.faces.model.SelectItem> |
getTimeZoneSelectItems(String addTimeZoneId,
List<String> timezones)
Returns a list of SelectItems for the timezones passed in.
|
public static List<javax.faces.model.SelectItem> getCommonTimeZoneSelectItems()
public static List<javax.faces.model.SelectItem> getCommonTimeZoneSelectItems(String timeZoneId)
timeZoneId - If the specified timezone with this id is not present in the common list,
it will be inserted in raw offset order after the common timezones with the same raw offset.public static List<javax.faces.model.SelectItem> getCommonTimeZoneSelectItems(Locale loc, TimeZone addTimeZone)
loc - Determines the locale/translations for the timezone namesaddTimeZone - If the specified timezone is not present in the common list,
it will be inserted in raw offset order.public static List<javax.faces.model.SelectItem> getTimeZoneSelectItems(String addTimeZoneId, List<String> timezones)
addTimeZoneId - If the specified timezone is not present in the timezones list, it will be inserted in
raw offset order after existing timezones with the same raw offset.timezones - A List of TimeZone ids, sorted by increasing raw offset orderpublic static List<javax.faces.model.SelectItem> getTimeZoneSelectItems(Locale translationLocale, TimeZone addTimeZone, List<String> timezones)
translationLocale - The local to translate to.addTimeZone - If the specified timezone is not present in the timezones list, it will be inserted in
raw offset order after existing timezones with the same raw offset.timezones - A List of TimeZone ids, sorted by increasing raw offset orderpublic static String getActualTimeZoneId(TimeZone addTimeZone)
addTimeZone - Timezone whose id is requiredpublic static List<String> getTimeZoneKeys(Locale loc, List<String> timezones)
loc - Determines the locale/translations for the timezone namestimezones - A List of TimeZone ids, passed by the userpublic static TimeZone getActualTimeZone(TimeZone tz)
tz - Timezone to checkpublic static String getTimeZoneDisplayName(Locale loc, String timezoneID)
loc - Locale for display name of requested timezonetimezoneID - Requested TimeZone, should be one of Java's 500+ Timezones