Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter
11g Release 1 (11.1.1.3.0)
E15995-02


oracle.webcenter.generalsettings.model
Class TimeZoneSetting

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


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

Shared Preferences for 'Time Zone' Settings.


Field Summary
static java.lang.String DEFAULT_TIMEZONE_ID
          The time zone used if not set by the user or default preference (based on the server's time zone.
static java.lang.String TIME_ZONE_KEY
          The internal preference key used for storing the timezone preference.

 

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

 

Constructor Summary
TimeZoneSetting()
           

 

Method Summary
static java.util.Calendar getCurrentTime()
          Get current time (from the user's point of view) as a Calendar.
static java.lang.String getDefaultTimeZone()
          Returns the application's default time zone identifier.
static java.util.Calendar getGMTTime()
           
static int getMidnightOffset()
          Return the number of minutes since the previous midnight (from the user's point of view) so that, for example, at 4:00am, this would return 240 (4 hours X 60).
static java.util.Calendar getMidnightToday()
          Get Calendar object representing Midnight this morning (for example if the current time from the user's point of view is 14:00 on 24th May 2007, this method will return '00:00 24th May 2007'.
static int getMidnightYesterdayOffset()
          Return the number of minutes since the midnight of the previous night (from the user's point of view) so that, for example, at 4:00am this would return 1680 (4 hours X 60 + 24 hours X 60).
static java.lang.String getPreferredTimeZone()
          Returns the current user's preferred time zone identifier.
static java.util.TimeZone getUserTimeZone()
          Get the user's preferred TimeZone (as a TimeZone object).
static java.lang.String getUserTimeZonePref()
          Returns the current user's time zone identifier preference value, or null if the user preference is not set - designed to be used in building preference UIs.
static void setDefaultTimeZone(java.lang.String timezone)
          Set the application's time zone identifier.
static void setPreferredTimeZone(java.lang.String timezone)
          Deprecated. replaced by setUserTimeZonePref()
static void setUserTimeZone(java.util.TimeZone timezone)
          Set the user's preferred TimeZone (as a TimeZone object).
static void setUserTimeZonePref(java.lang.String timezone)
          Set the current user's preferred time zone identifier.

 

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

 

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

 

Field Detail

TIME_ZONE_KEY

public static final java.lang.String TIME_ZONE_KEY
The internal preference key used for storing the timezone preference.
See Also:
Constant Field Values

DEFAULT_TIMEZONE_ID

public static java.lang.String DEFAULT_TIMEZONE_ID
The time zone used if not set by the user or default preference (based on the server's time zone.

Constructor Detail

TimeZoneSetting

public TimeZoneSetting()

Method Detail

getPreferredTimeZone

public static java.lang.String getPreferredTimeZone()
Returns the current user's preferred time zone identifier.

The time zone identifier returned is of the format GMT{+|-}hh:mi e.g. GMT+05:30 or GMT-08:05. This identifier can be used to create a java.util.TimeZone object as follows :-
TimeZone.getTimeZone("GMT+05:30");

Returns:
the logged in user's preferred time zone identifier

getUserTimeZonePref

public static java.lang.String getUserTimeZonePref()
Returns the current user's time zone identifier preference value, or null if the user preference is not set - designed to be used in building preference UIs.

The time zone identifier returned is of the format GMT{+|-}hh:mi e.g. GMT+05:30 or GMT-08:05.

Returns:
the current user's time zone identifier preference value or null if the user preference is not set.

setPreferredTimeZone

public static void setPreferredTimeZone(java.lang.String timezone)
Deprecated. replaced by setUserTimeZonePref()

setUserTimeZonePref

public static void setUserTimeZonePref(java.lang.String timezone)
Set the current user's preferred time zone identifier.

The time zone identifier should be of the format GMT{+|-}hh:mi e.g. GMT+05:30 or GMT-08:05.

Parameters:
timezone - the preferred time zone identifier

getDefaultTimeZone

public static java.lang.String getDefaultTimeZone()
Returns the application's default time zone identifier.

The time zone identifier returned is of the format GMT{+|-}hh:mi e.g. GMT+05:30 or GMT-08:05. This identifier can be used to create a java.util.TimeZone object as follows :-
TimeZone.getTimeZone("GMT+05:30");

Returns:
the application's default time zone identifier

setDefaultTimeZone

public static void setDefaultTimeZone(java.lang.String timezone)
Set the application's time zone identifier.

The time zone identifier should be of the format GMT{+|-}hh:mi e.g. GMT+05:30 or GMT-08:05.

Parameters:
timezone - the preferred time zone identifier

getUserTimeZone

public static java.util.TimeZone getUserTimeZone()
Get the user's preferred TimeZone (as a TimeZone object).

setUserTimeZone

public static void setUserTimeZone(java.util.TimeZone timezone)
Set the user's preferred TimeZone (as a TimeZone object).

getCurrentTime

public static java.util.Calendar getCurrentTime()
Get current time (from the user's point of view) as a Calendar.

getMidnightToday

public static java.util.Calendar getMidnightToday()
Get Calendar object representing Midnight this morning (for example if the current time from the user's point of view is 14:00 on 24th May 2007, this method will return '00:00 24th May 2007'.

getMidnightOffset

public static int getMidnightOffset()
Return the number of minutes since the previous midnight (from the user's point of view) so that, for example, at 4:00am, this would return 240 (4 hours X 60).
Returns:
number of minutes since midnight

getMidnightYesterdayOffset

public static int getMidnightYesterdayOffset()
Return the number of minutes since the midnight of the previous night (from the user's point of view) so that, for example, at 4:00am this would return 1680 (4 hours X 60 + 24 hours X 60).
Returns:
number of minutes since midnight yesterday

getGMTTime

public static java.util.Calendar getGMTTime()

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter
11g Release 1 (11.1.1.3.0)
E15995-02


Copyright © 2009, 2010, Oracle. All rights reserved.