Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.6.0)
E15995-04


oracle.webcenter.generalsettings.model
Class DateFormatSetting

java.lang.Object
  extended by oracle.webcenter.generalsettings.internal.model.GSPreferences
      extended by oracle.webcenter.generalsettings.model.DateFormatSetting


public class DateFormatSetting
extends oracle.webcenter.generalsettings.internal.model.GSPreferences

Shared Preferences for 'Date Style/Format' and 'Time Style/Format' Settings.


Nested Class Summary
static class DateFormatSetting.DateTimeStyle
          Provides the date and time styles in an application.

 

Field Summary
static DateFormatSetting.DateTimeStyle DEFAULT_DATE_STYLE
          The default date style when no preference is set (DateTypeStyle.SHORT).
static DateFormatSetting.DateTimeStyle DEFAULT_TIME_STYLE
          The default time style when no preference is set (DateTypeStyle.SHORT).
static java.lang.String PREFERRED_DATE_PATTERN_KEY
          Internal preference key to store the date pattern preference.
static java.lang.String PREFERRED_DATE_STYLE_KEY
          Internal preference key to store the date style preference.
static java.lang.String PREFERRED_DATETIME_PATTERN_KEY
          Internal preference key to store the date-time pattern preference.
static java.lang.String PREFERRED_TIME_PATTERN_KEY
          Internal preference key to store the time pattern preference.
static java.lang.String PREFERRED_TIME_STYLE_KEY
          Internal preference key to store the time style preference.
static java.lang.String TYPE_BOTH
          Used with getPreferredPatternByType() to return the preferred time and date pattern.
static java.lang.String TYPE_DATE
          Used with getPreferredPatternByType() to return the preferred date pattern.
static java.lang.String TYPE_TIME
          Used with getPreferredPatternByType() to return the preferred time pattern.

 

Fields inherited from class oracle.webcenter.generalsettings.internal.model.GSPreferences
NULL_VALUE

 

Constructor Summary
DateFormatSetting()
           

 

Method Summary
static java.lang.String getDatePattern()
          Gets the current user's preferred date pattern.
static java.lang.String getDatePattern(java.lang.String username)
          Gets the given user's preferred date pattern.
static DateFormatSetting.DateTimeStyle getDateStyle()
          Returns the current user's preferred date style.
static DateFormatSetting.DateTimeStyle getDateStyle(java.lang.String username)
          Returns the given user's preferred date style.
static java.text.DateFormat getDateTimeFormatter()
          Gets a DateFormat object with the current user's preferred timezone, date and time format applied.
static java.text.DateFormat getDateTimeFormatter(java.lang.String username)
          Gets a DateFormat object with the given user's preferred timezone, date and time format applied.
static java.lang.String getDateTimePattern()
          If a date and time pattern preference is set for the current user then returns a pattern representing datePattern+timePattern.
static java.lang.String getDateTimePattern(java.lang.String username)
          If a date and time pattern preference is set for the given user then returns a pattern representing datePattern+timePattern.
static java.lang.String getFormattedCurrentDate()
          Gets the current date in the current user's preferred timezone and date format.
static java.lang.String getFormattedCurrentDate(java.lang.String username)
          Gets the current date in the given user's preferred timezone and date format.
static java.lang.String getFormattedCurrentDateTime()
          Gets the current date and time in the current user's preferred timezone, date and time format.
static java.lang.String getFormattedCurrentDateTime(java.lang.String username)
          Gets the current date and time in the given user's preferred timezone, date and time format.
static java.lang.String getFormattedCurrentTime()
          Gets the current time in the user's preferred timezone and time format.
static java.lang.String getFormattedCurrentTime(java.lang.String username)
          Gets the current time in the user's preferred timezone and time format.
static java.lang.String getFormattedDate(java.util.Date date)
          Gets the given date in the current user's preferred timezone and date format.
static java.lang.String getFormattedDate(java.lang.String username, java.util.Date date)
          Gets the given date in the given user's preferred timezone and date format.
static java.lang.String getFormattedDateTime(java.util.Calendar dateTime)
          Gets the given date and time in the current user's preferred timezone, date and time format.
static java.lang.String getFormattedDateTime(java.util.Date dateTime)
          Gets the given date and time in the current user's preferred timezone, date and time format.
static java.lang.String getFormattedDateTime(java.lang.String username, java.util.Calendar dateTime)
          Gets the given date and time in the given user's preferred timezone, date and time format.
static java.lang.String getFormattedDateTime(java.lang.String username, java.util.Date dateTime)
          Gets the given date and time in the given user's preferred timezone, date and time format.
static java.lang.String getFormattedTime(java.util.Date time)
          Gets the given time in the current user's preferred timezone and time format.
static java.lang.String getFormattedTime(java.lang.String username, java.util.Date time)
          Gets the given time in the given user's preferred timezone and time format.
static java.lang.String getPreferredPatternByType(java.lang.String type)
          Gets the preferred pattern for the current user based on the type parameter value.
static java.lang.String getPreferredPatternByType(java.lang.String username, java.lang.String type)
          Get the preferred pattern for the given user based on the given type parameter value.
static java.lang.String getSystemDatePatternPreference()
          Returns the system date format pattern preference for the application.
static DateFormatSetting.DateTimeStyle getSystemDateStylePreference()
          Returns the system date style preference for the application.
static java.lang.String getSystemTimePatternPreference()
          Returns the system time pattern preference for the application.
static DateFormatSetting.DateTimeStyle getSystemTimeStylePreference()
          Returns the system time style preference for the application.
static java.lang.String getTimePattern()
          Gets the current user's preferred time pattern.
static java.lang.String getTimePattern(java.lang.String username)
          Gets the given user's preferred time pattern.
static DateFormatSetting.DateTimeStyle getTimeStyle()
          Returns the current user's preferred time style.
static DateFormatSetting.DateTimeStyle getTimeStyle(java.lang.String username)
          Returns the given user's preferred time style.
static java.text.DateFormat getUserDateFormat()
          Returns a DateFormat based on the current user's date style preference, locale and time zone.
static java.text.DateFormat getUserDateFormat(java.lang.String username)
          Returns a DateFormat based on the given user's date style preference, locale and time zone.
static java.lang.String getUserDatePatternPreference()
          Returns the current user's date pattern preference.
static java.lang.String getUserDatePatternPreference(java.lang.String username)
          Returns the current user's date pattern preference.
static DateFormatSetting.DateTimeStyle getUserDateStylePreference()
          Returns the given user's date style preference.
static DateFormatSetting.DateTimeStyle getUserDateStylePreference(java.lang.String username)
          Returns the given user's date style preference.
static java.text.DateFormat getUserDateTimeFormat()
          Returns a DateFormat based on the current user's date and time style preference, locale and time zone.
static java.text.DateFormat getUserDateTimeFormat(java.lang.String username)
          Returns a DateFormat based on the given user's date and time style preference, locale and TimeZone.
static java.lang.String getUserDateTimePatternPreference()
          Gets the current user's combined date and time format pattern preferences.
static java.lang.String getUserDateTimePatternPreference(java.lang.String username)
          Gets the given user's combined date and time format pattern preferences.
static java.text.DateFormat getUserTimeFormat()
          Returns a DateFormat based on the current user's time style preference, locale and time zone.
static java.text.DateFormat getUserTimeFormat(java.lang.String username)
          Returns a DateFormat based on the given user's time style preference, locale and time zone.
static java.lang.String getUserTimePatternPreference()
          Returns the current user's time pattern preference.
static java.lang.String getUserTimePatternPreference(java.lang.String username)
          Returns the given user's time pattern preference.
static DateFormatSetting.DateTimeStyle getUserTimeStylePreference()
          Returns the current user's time style preference.
static DateFormatSetting.DateTimeStyle getUserTimeStylePreference(java.lang.String username)
          Returns the given user's time style preference.
static void setSystemDatePatternPreference(java.lang.String pattern)
          Sets the default date format pattern for the application.
static void setSystemDateStylePreference(DateFormatSetting.DateTimeStyle dateStyle)
          Sets the default date style for the application.
static void setSystemTimePatternPreference(java.lang.String pattern)
          Sets the default time format pattern for the application.
static void setSystemTimeStylePreference(DateFormatSetting.DateTimeStyle timeStyle)
          Sets the default time style for the application.
static void setUserDatePatternPreference(java.lang.String pattern)
          Sets the preferred date pattern for the current user.
static void setUserDatePatternPreference(java.lang.String username, java.lang.String pattern)
          Sets the preferred date pattern for the given user.
static void setUserDateStylePreference(DateFormatSetting.DateTimeStyle dateStyle)
          Sets the preferred date style for the username.
static void setUserDateStylePreference(java.lang.String username, DateFormatSetting.DateTimeStyle dateStyle)
          Sets the preferred date style for the username.
static void setUserDateTimePatternPreference(java.lang.String pattern)
          Sets the user's combined date and time format pattern preference.
static void setUserDateTimePatternPreference(java.lang.String username, java.lang.String pattern)
          Sets the user's combined date and time format pattern preference.
static void setUserTimePatternPreference(java.lang.String pattern)
          Sets the time pattern preference for the current user.
static void setUserTimePatternPreference(java.lang.String username, java.lang.String pattern)
          Sets the time style preference for the current user.
static void setUserTimeStylePreference(DateFormatSetting.DateTimeStyle timeStyle)
          Sets the time style preference for the current user.
static void setUserTimeStylePreference(java.lang.String username, DateFormatSetting.DateTimeStyle timeStyle)
          Sets the time style preference for the given user.

 

Methods inherited from class oracle.webcenter.generalsettings.internal.model.GSPreferences
getPreferred, getPreferred, getProvider, getSystemPref, getUserPref, getUserPref, log, setSystemPref, setUserPref

 

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

 

Field Detail

PREFERRED_TIME_STYLE_KEY

public static final java.lang.String PREFERRED_TIME_STYLE_KEY
Internal preference key to store the time style preference.
See Also:
Constant Field Values

PREFERRED_DATE_STYLE_KEY

public static final java.lang.String PREFERRED_DATE_STYLE_KEY
Internal preference key to store the date style preference.
See Also:
Constant Field Values

PREFERRED_TIME_PATTERN_KEY

public static final java.lang.String PREFERRED_TIME_PATTERN_KEY
Internal preference key to store the time pattern preference.
See Also:
Constant Field Values

PREFERRED_DATE_PATTERN_KEY

public static final java.lang.String PREFERRED_DATE_PATTERN_KEY
Internal preference key to store the date pattern preference.
See Also:
Constant Field Values

PREFERRED_DATETIME_PATTERN_KEY

public static final java.lang.String PREFERRED_DATETIME_PATTERN_KEY
Internal preference key to store the date-time pattern preference.
See Also:
Constant Field Values

TYPE_DATE

public static final java.lang.String TYPE_DATE
Used with getPreferredPatternByType() to return the preferred date pattern.
See Also:
getPreferredPatternByType(String), Constant Field Values

TYPE_TIME

public static final java.lang.String TYPE_TIME
Used with getPreferredPatternByType() to return the preferred time pattern.
See Also:
getPreferredPatternByType(String), Constant Field Values

TYPE_BOTH

public static final java.lang.String TYPE_BOTH
Used with getPreferredPatternByType() to return the preferred time and date pattern.
See Also:
getPreferredPatternByType(String), Constant Field Values

DEFAULT_DATE_STYLE

public static final DateFormatSetting.DateTimeStyle DEFAULT_DATE_STYLE
The default date style when no preference is set (DateTypeStyle.SHORT).

DEFAULT_TIME_STYLE

public static final DateFormatSetting.DateTimeStyle DEFAULT_TIME_STYLE
The default time style when no preference is set (DateTypeStyle.SHORT).

Constructor Detail

DateFormatSetting

public DateFormatSetting()

Method Detail

getTimeStyle

public static DateFormatSetting.DateTimeStyle getTimeStyle()
Returns the current user's preferred time style. If a preference value is not set for the user, returns the default value. This method returns :- This API is used to get the user's preferred DateTimeStyle enum for the Time component. This enum provides the 'short', 'medium', 'long', 'full' setting. The value returned by the getValue() method of DateTimeStyle can be used directly in the timeStyle attribute of af:convertDateTime or f:convertDateTime tags. This value, along with an appropriate value for the locale attribute, will format/parse your date output/input in accordance with the current locale.
Returns:
The time style preference. If the time style preference is not set, returns a default value.

getTimeStyle

public static DateFormatSetting.DateTimeStyle getTimeStyle(java.lang.String username)
Returns the given user's preferred time style. If a preference value is not set for the user, returns the default value. This method returns :- This API is used to get the user's preferred DateTimeStyle enum for the Time component. This enum provides the 'short', 'medium', 'long', 'full' setting. The value returned by the getValue() method of DateTimeStyle can be used directly in the timeStyle attribute of af:convertDateTime or f:convertDateTime tags. This value, along with an appropriate value for the locale attribute, will format/parse your date output/input in accordance with the current locale.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
The time style preference. If the time style preference is not set, returns a default value.

getTimePattern

public static java.lang.String getTimePattern()
Gets the current user's preferred time pattern. If a time patten preference has not been set, it returns null. The normal case is for this to return null as time styles are generally used rather than time patterns. getTimeStyle() should be used in preference to this API.
Returns:
time pattern. If it has not been set (usual case), returns null

getTimePattern

public static java.lang.String getTimePattern(java.lang.String username)
Gets the given user's preferred time pattern. If a time patten preference has not been set, it returns null. The normal case is for this to return null as time styles are generally used rather than time patterns. getTimeStyle() should be used in preference to this API.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
time pattern. If it has not been set (usual case), returns null

getUserTimeStylePreference

public static DateFormatSetting.DateTimeStyle getUserTimeStylePreference()
Returns the current user's time style preference. If a preference is not set for the user, returns null. This API is designed to be used in a user preference setting UI, for all other uses, the getTimeStyle() API should be used.
Returns:
the current user's time style preference. If the preference is not set for the user, returns null.

getUserTimeStylePreference

public static DateFormatSetting.DateTimeStyle getUserTimeStylePreference(java.lang.String username)
Returns the given user's time style preference. If a preference is not set for the user, returns null. This API is designed to be used in a user preference setting UI, for all other uses, the getTimeStyle() API must be used.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
the given user's time style preference. If the preference is not set for the user, returns null.

getUserTimePatternPreference

public static java.lang.String getUserTimePatternPreference()
Returns the current user's time pattern preference. If a preference is not set for the user, returns null. Generally, this method will return null as time styles are used in preference to time patterns. This API is designed to be used in a user preference setting UI, for all other uses, the getTimePattern() API must be used.
Returns:
the current user's time pattern preference. If the preference is not set for the user, returns null.

getUserTimePatternPreference

public static java.lang.String getUserTimePatternPreference(java.lang.String username)
Returns the given user's time pattern preference. If a preference is not set for the user, returns null. Generally, this method will return null as time styles are used in preference to time patterns. This API is designed to be used in a user preference setting UI, for all other uses, the getTimePattern() API must be used.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
the given user's time pattern preference. If the preference is not set for the user, returns null.

setUserTimeStylePreference

public static void setUserTimeStylePreference(DateFormatSetting.DateTimeStyle timeStyle)
Sets the time style preference for the current user.
Parameters:
timeStyle - the time style string chosen by the user

setUserTimeStylePreference

public static void setUserTimeStylePreference(java.lang.String username,
                                              DateFormatSetting.DateTimeStyle timeStyle)
Sets the time style preference for the given user.
Parameters:
username - the username to set the preference for. If null, sets the preference for the current authenticated user
timeStyle - the time style string chosen by the user

setUserTimePatternPreference

public static void setUserTimePatternPreference(java.lang.String pattern)
Sets the time pattern preference for the current user. Note that styles are generally used instead of patterns. Setting the pattern will override the style.
Parameters:
pattern - the time pattern to set

setUserTimePatternPreference

public static void setUserTimePatternPreference(java.lang.String username,
                                                java.lang.String pattern)
Sets the time style preference for the current user.
Parameters:
username - the username to set the preference for. If null, sets the preference for the current authenticated user
pattern - the time pattern to set

getSystemTimeStylePreference

public static DateFormatSetting.DateTimeStyle getSystemTimeStylePreference()
Returns the system time style preference for the application. This method will return null if no time style preference is set for the application.
Returns:
The system time style preference

getSystemTimePatternPreference

public static java.lang.String getSystemTimePatternPreference()
Returns the system time pattern preference for the application. This method will return null if no time pattern preference is set for the application.
Returns:
The system time pattern preference

setSystemTimeStylePreference

public static void setSystemTimeStylePreference(DateFormatSetting.DateTimeStyle timeStyle)
Sets the default time style for the application.
Parameters:
timeStyle - the system time format preference for the application

setSystemTimePatternPreference

public static void setSystemTimePatternPreference(java.lang.String pattern)
Sets the default time format pattern for the application.
Parameters:
pattern - the system time format pattern preference for the application

getDateStyle

public static DateFormatSetting.DateTimeStyle getDateStyle()
Returns the current user's preferred date style. If a preference value is not set for the user, returns the default value. This method returns :- This API is used to get the user's preferred DateTimeStyle enum for the Date component. This enum provides the 'short', 'medium', 'long', 'full' setting. The value returned by the getValue() method of DateTimeStyle can be used directly in the dateStyle attribute of af:convertDateTime or f:convertDateTime tags. This value, along with an appropriate value for the locale attribute, will format/parse your date output/input in accordance with the current locale.
Returns:
The date style preference. If the date style preference is not set, returns a default value.

getDateStyle

public static DateFormatSetting.DateTimeStyle getDateStyle(java.lang.String username)
Returns the given user's preferred date style. If a preference value is not set for the user, returns the default value. This method returns :- This API is used to get the user's preferred DateTimeStyle enum for the Date component. This enum provides the 'short', 'medium', 'long', 'full' setting. The value returned by the getValue() method of DateTimeStyle can be used directly in the dateStyle attribute of af:convertDateTime or f:convertDateTime tags. This value, along with an appropriate value for the locale attribute, will format/parse your date output/input in accordance with the current locale.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
The date style preference. If the date style preference is not set, returns a default value.

getDatePattern

public static java.lang.String getDatePattern()
Gets the current user's preferred date pattern. If a date patten preference has not been set, it returns null. The normal case is for this to return null as date styles are generally used rather than date patterns. getDateStyle() should be used in preference to this API.
Returns:
date pattern. If it has not been set (usual case), returns null

getDatePattern

public static java.lang.String getDatePattern(java.lang.String username)
Gets the given user's preferred date pattern. If a date patten preference has not been set, it returns null. The normal case is for this to return null as date styles are generally used rather than date patterns. getDateStyle() should be used in preference to this API.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
date pattern. If it has not been set (usual case), returns null

getUserDateStylePreference

public static DateFormatSetting.DateTimeStyle getUserDateStylePreference()
Returns the given user's date style preference. If a preference is not set for the user, returns null. This API is designed to be used in a user preference setting UI, for all other uses, the getDateStyle() API must be used.
Returns:
the given user's date style preference. If the preference is not set for the user, returns null.

getUserDateStylePreference

public static DateFormatSetting.DateTimeStyle getUserDateStylePreference(java.lang.String username)
Returns the given user's date style preference. If a preference is not set for the user, returns null. This API is designed to be used in a user preference setting UI, for all other uses, the getDateStyle() API must be used.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
the given user's date style preference. If the preference is not set for the user, returns null.

getUserDatePatternPreference

public static java.lang.String getUserDatePatternPreference()
Returns the current user's date pattern preference. If a preference is not set for the user, returns null. Generally, this method will return null as date styles are used in preference to date patterns. This API is designed to be used in a user preference setting UI, for all other uses, the getDatePattern() API must be used.
Returns:
the current user's date pattern preference. If the preference is not set for the user, returns null.

getUserDatePatternPreference

public static java.lang.String getUserDatePatternPreference(java.lang.String username)
Returns the current user's date pattern preference. If a preference is not set for the user, returns null. Generally, this method will return null as date styles are used in preference to date patterns. This API is designed to be used in a user preference setting UI, for all other uses, the getDatePattern() API must be used.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
the current user's date pattern preference. If the preference is not set for the user, returns null.

setUserDateStylePreference

public static void setUserDateStylePreference(DateFormatSetting.DateTimeStyle dateStyle)
Sets the preferred date style for the username.
Parameters:
dateStyle - the date style string chosen by the user

setUserDateStylePreference

public static void setUserDateStylePreference(java.lang.String username,
                                              DateFormatSetting.DateTimeStyle dateStyle)
Sets the preferred date style for the username.
Parameters:
username - the username to set the preference for. If null, sets the preference for the current authenticated user
dateStyle - the date style string chosen by the user

setUserDatePatternPreference

public static void setUserDatePatternPreference(java.lang.String pattern)
Sets the preferred date pattern for the current user. Note that styles are generally used instead of patterns. Setting the pattern will override the style.
Parameters:
pattern - the date pattern string chosen by the user

setUserDatePatternPreference

public static void setUserDatePatternPreference(java.lang.String username,
                                                java.lang.String pattern)
Sets the preferred date pattern for the given user.
Parameters:
username - the username to set the preference for. If null, sets the preference for the current authenticated user
pattern - the date pattern string chosen by the user

getSystemDateStylePreference

public static DateFormatSetting.DateTimeStyle getSystemDateStylePreference()
Returns the system date style preference for the application. This method will return null if no date style preference is set for the application.
Returns:
The system date style preference

getSystemDatePatternPreference

public static java.lang.String getSystemDatePatternPreference()
Returns the system date format pattern preference for the application. This method will return null if no date format pattern preference is set for the application. This is the usual case as date styles are used in preference to date format patterns.
Returns:
The system date pattern preference or null if no preference exists.

setSystemDateStylePreference

public static void setSystemDateStylePreference(DateFormatSetting.DateTimeStyle dateStyle)
Sets the default date style for the application.
Parameters:
dateStyle - the system date style preference for the application

setSystemDatePatternPreference

public static void setSystemDatePatternPreference(java.lang.String pattern)
Sets the default date format pattern for the application.
Parameters:
pattern - the system date format pattern preference for the application

getDateTimePattern

public static java.lang.String getDateTimePattern()
If a date and time pattern preference is set for the current user then returns a pattern representing datePattern+timePattern. If either or both are null, returns null. The normal case is for this to return null as date and time styles are generally used rather than date and time patterns.
Returns:
if datePattern and timePattern is set, returns datePattern+timePattern values, else returns null

getDateTimePattern

public static java.lang.String getDateTimePattern(java.lang.String username)
If a date and time pattern preference is set for the given user then returns a pattern representing datePattern+timePattern. If either or both are null, returns null. The normal case is for this to return null as date and time styles are generally used rather than date and time patterns.
Parameters:
username - the username to obtain the preferences for. If null, obtains the preferences for the current authenticated user
Returns:
if datePattern and timePattern is set, returns datePattern+timePattern values, else returns null

setUserDateTimePatternPreference

public static void setUserDateTimePatternPreference(java.lang.String pattern)
Sets the user's combined date and time format pattern preference.
Parameters:
pattern - the combined date and time format pattern to set

setUserDateTimePatternPreference

public static void setUserDateTimePatternPreference(java.lang.String username,
                                                    java.lang.String pattern)
Sets the user's combined date and time format pattern preference.
Parameters:
username - the username to set the preference for. If null, sets the preference for the current authenticated user
pattern - the combined date-time format pattern to set

getUserDateTimePatternPreference

public static java.lang.String getUserDateTimePatternPreference()
Gets the current user's combined date and time format pattern preferences. If the preferences are not set this API returns null.
Returns:
the user's combined date and time format pattern preference value. If the preference value is not set, returns null.

getUserDateTimePatternPreference

public static java.lang.String getUserDateTimePatternPreference(java.lang.String username)
Gets the given user's combined date and time format pattern preferences. If the preferences are not set this API returns null.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
the user's combined date and time format pattern preference value. If the preference value is not set, returns null.

getUserDateFormat

public static java.text.DateFormat getUserDateFormat()
Returns a DateFormat based on the current user's date style preference, locale and time zone. If the preferences are not set, the DateFormat is based on the DEFAULT_DATE_STYLE.
Returns:
DateFormat based on the user's date style preference

getUserDateFormat

public static java.text.DateFormat getUserDateFormat(java.lang.String username)
Returns a DateFormat based on the given user's date style preference, locale and time zone. If the preferences are not set, the DateFormat is based on the DEFAULT_DATE_STYLE.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
DateFormat based on the user's date style preference

getUserTimeFormat

public static java.text.DateFormat getUserTimeFormat()
Returns a DateFormat based on the current user's time style preference, locale and time zone. If the preferences are not set, the DateFormat is based on the DEFAULT_TIME_STYLE.
Returns:
DateFormat based on the user's time style preference

getUserTimeFormat

public static java.text.DateFormat getUserTimeFormat(java.lang.String username)
Returns a DateFormat based on the given user's time style preference, locale and time zone. If the preferences are not set, the DateFormat is based on the DEFAULT_TIME_STYLE.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
DateFormat based on the user's time style preference

getUserDateTimeFormat

public static java.text.DateFormat getUserDateTimeFormat()
Returns a DateFormat based on the current user's date and time style preference, locale and time zone. If the preferences are not set, the DateFormat is based on the DEFAULT_DATE_STYLE and DEFAULT_TIME_STYLE.
Returns:
DateFormat based on the user's date and time style preference

getUserDateTimeFormat

public static java.text.DateFormat getUserDateTimeFormat(java.lang.String username)
Returns a DateFormat based on the given user's date and time style preference, locale and TimeZone. If the preferences are not set, the DateFormat is based on the DEFAULT_DATE_STYLE and DEFAULT_TIME_STYLE.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
DateFormat based on the user's date and time style preference

getFormattedDate

public static java.lang.String getFormattedDate(java.util.Date date)
Gets the given date in the current user's preferred timezone and date format.
Returns:
a String representation of the given date.

getFormattedDate

public static java.lang.String getFormattedDate(java.lang.String username,
                                                java.util.Date date)
Gets the given date in the given user's preferred timezone and date format.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
a String representation of the given date.

getFormattedTime

public static java.lang.String getFormattedTime(java.util.Date time)
Gets the given time in the current user's preferred timezone and time format.
Returns:
a String representation of the given time.

getFormattedTime

public static java.lang.String getFormattedTime(java.lang.String username,
                                                java.util.Date time)
Gets the given time in the given user's preferred timezone and time format.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
a String representation of the given time.

getFormattedCurrentDate

public static java.lang.String getFormattedCurrentDate()
Gets the current date in the current user's preferred timezone and date format.
Returns:
a String representation of the current date.

getFormattedCurrentDate

public static java.lang.String getFormattedCurrentDate(java.lang.String username)
Gets the current date in the given user's preferred timezone and date format.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
a String representation of the current date.

getFormattedCurrentTime

public static java.lang.String getFormattedCurrentTime()
Gets the current time in the user's preferred timezone and time format.
Returns:
a String representation of the current time.

getFormattedCurrentTime

public static java.lang.String getFormattedCurrentTime(java.lang.String username)
Gets the current time in the user's preferred timezone and time format.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
a String representation of the current time.

getDateTimeFormatter

public static java.text.DateFormat getDateTimeFormatter()
Gets a DateFormat object with the current user's preferred timezone, date and time format applied. This API can be used to obtain a DateFormat in order to format a set of dates and/or times.
Returns:
a DateFormatter to format dates/times for the current user

getDateTimeFormatter

public static java.text.DateFormat getDateTimeFormatter(java.lang.String username)
Gets a DateFormat object with the given user's preferred timezone, date and time format applied. This API can be used to obtain a DateFormat in order to format a set of dates and/or times.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
a DateFormatter to format dates/times for the current user

getFormattedDateTime

public static java.lang.String getFormattedDateTime(java.util.Date dateTime)
Gets the given date and time in the current user's preferred timezone, date and time format.
Returns:
a String representation of the given date and time.

getFormattedDateTime

public static java.lang.String getFormattedDateTime(java.lang.String username,
                                                    java.util.Date dateTime)
Gets the given date and time in the given user's preferred timezone, date and time format.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
a String representation of the given date and time.

getFormattedDateTime

public static java.lang.String getFormattedDateTime(java.util.Calendar dateTime)
Gets the given date and time in the current user's preferred timezone, date and time format.
Returns:
a String representation of the given date and time.

getFormattedDateTime

public static java.lang.String getFormattedDateTime(java.lang.String username,
                                                    java.util.Calendar dateTime)
Gets the given date and time in the given user's preferred timezone, date and time format.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
A String representation of the given date and time.

getFormattedCurrentDateTime

public static java.lang.String getFormattedCurrentDateTime()
Gets the current date and time in the current user's preferred timezone, date and time format.
Returns:
a String representation of the current date and time.

getFormattedCurrentDateTime

public static java.lang.String getFormattedCurrentDateTime(java.lang.String username)
Gets the current date and time in the given user's preferred timezone, date and time format.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
a String representation of the current date and time.

getPreferredPatternByType

public static java.lang.String getPreferredPatternByType(java.lang.String type)
Gets the preferred pattern for the current user based on the type parameter value. Valid values for this parameter are: date, time, and both.
Parameters:
type - Either date, time, or both
Returns:
the user's preferred pattern. If the preference is not set or the type is not recognized, returns null
See Also:
TYPE_DATE, TYPE_TIME, TYPE_BOTH

getPreferredPatternByType

public static java.lang.String getPreferredPatternByType(java.lang.String username,
                                                         java.lang.String type)
Get the preferred pattern for the given user based on the given type parameter value. Valid values for this parameter are: date, time, and both.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
type - Either date, time, or both
Returns:
the user's preferred pattern. If the preference is not set or the type is not recognized, returns null
See Also:
TYPE_DATE, TYPE_TIME, TYPE_BOTH

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.6.0)
E15995-04


Copyright © 2009, 2011, Oracle and/or its affiliates. All rights reserved.