Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1)
E10684-06


oracle.adf.view.rich.util
Class DateTimeUtils

java.lang.Object
  extended by oracle.adf.view.rich.util.DateTimeUtils


public final class DateTimeUtils
extends java.lang.Object

Provides utilities for processing Date objects. Contains a list of commonly used timezones supplied by globalization, and methods to retrieve the translated timezone names for a timezone.


Method Summary
static java.util.TimeZone getActualTimeZone(java.util.TimeZone tz)
          The entire time zone repository contains 500+ time zones.
static java.util.List<javax.faces.model.SelectItem> getCommonTimeZoneSelectItems()
          Returns a list of commonly used timezones, sorted by the timezone's raw offset.
static java.util.List<javax.faces.model.SelectItem> getCommonTimeZoneSelectItems(java.util.Locale loc, java.util.TimeZone addTimeZone)
          Returns a list of commonly used timezones, sorted by the timezone's raw offset.
static java.util.List<javax.faces.model.SelectItem> getCommonTimeZoneSelectItems(java.lang.String timeZoneId)
          Returns a list of commonly used timezones, sorted by the timezone's raw offset.
static java.lang.String getTimeZoneDisplayName(java.util.Locale loc, java.lang.String timezoneID)
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

getCommonTimeZoneSelectItems

public static java.util.List<javax.faces.model.SelectItem> getCommonTimeZoneSelectItems()
Returns a list of commonly used timezones, sorted by the timezone's raw offset. The SelectItems have id=timezoneId, value= translated timezone name using the view root locale.

getCommonTimeZoneSelectItems

public static java.util.List<javax.faces.model.SelectItem> getCommonTimeZoneSelectItems(java.lang.String timeZoneId)
Returns a list of commonly used timezones, sorted by the timezone's raw offset. The SelectItems have id=timezoneId, value= translated timezone name, using the view root locale.
Parameters:
timeZoneId - If the specified timezone with this id is not present in the common list, it will be inserted in raw offset order.

getCommonTimeZoneSelectItems

public static java.util.List<javax.faces.model.SelectItem> getCommonTimeZoneSelectItems(java.util.Locale loc,
                                                                                        java.util.TimeZone addTimeZone)
Returns a list of commonly used timezones, sorted by the timezone's raw offset. The SelectItems have id=timezoneId, value= translated timezone name
Parameters:
loc - Determines the locale/translations for the timezone names
tzone - If the specified timezone is not present in the common list, it will be inserted in raw offset order.

getActualTimeZone

public static java.util.TimeZone getActualTimeZone(java.util.TimeZone tz)
The entire time zone repository contains 500+ time zones. Around half of them are "Aliases". For example, "US/Pacific" is an alias of "America/Los_Angeles". Internally, aliases shares time zone definitions with the corresponding actual timezone. In theory, by referring to time zone definitions, we can tell if a time zone id is an actual timezone or an alias. However, JRE java.util.TimeZone implementation does not expose this information thru its API. Hence, this helper method to determine if a timezone has an alias. Checks if a timezone is an alias, and returns its actual timezone instead. The Common timezone map only contains actual timezones.
Parameters:
tz - Timezone to check
Returns:
Timezone alias

getTimeZoneDisplayName

public static java.lang.String getTimeZoneDisplayName(java.util.Locale loc,
                                                      java.lang.String timezoneID)
Parameters:
loc - Locale for display name of requested timezone
timezoneID - Requested TimeZone, should be one of Java's 500+ Timezones
Returns:
the Display Name (translated) of a timezone The timezoneID does not need to be a "common" timezoneID, i.e. one of the 139 timezones returned by getTimeZoneDisplayItemes(). Both common and full list of timezone displaynames are maintained by globalization.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1)
E10684-06


Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.