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 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

TimeZoneSetting provides shared preferences for time zone settings.


Field Summary
static java.lang.String DEFAULT_TIMEZONE_ID
          The time zone used if the user does not set a time zone preference.
static java.lang.String TIME_ZONE_KEY
          The internal preference key to store the time zone preference.

 

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

 

Constructor Summary
TimeZoneSetting()
           

 

Method Summary
static java.util.Calendar getCurrentTime()
          Get the current time as a Calendar object based on the current user's timezone setting.
static java.util.Calendar getCurrentTime(java.lang.String username)
          Gets the current time as a Calendar object based on the given user's timezone setting.
static java.lang.String getDefaultTimeZone()
          Returns the application's default time zone identifier.
static java.util.Calendar getGMTTime()
          Returns a Calendar object representing the current time at the Greenwich Meridian (time zone GMT+00:00).
static int getMidnightOffset()
          Returns the number of minutes since midnight based on the current user's timezone setting.
static int getMidnightOffset(java.lang.String username)
          Returns the number of minutes since midnight based on the given user's timezone setting.
static java.util.Calendar getMidnightToday()
          Gets the Calendar object representing the midnight hour for the current date irrespective of the current time.
static java.util.Calendar getMidnightToday(java.lang.String username)
          Gets the Calendar object representing the midnight hour for the current date irrespective of the current time.
static int getMidnightYesterdayOffset()
          Returns the number of minutes since midnight of the previous night based on the current user's timezone setting.
static int getMidnightYesterdayOffset(java.lang.String username)
          Returns the number of minutes since midnight of the previous night based on the given user's timezone setting.
static java.lang.String getPreferredTimeZone()
          Returns the current user's preferred time zone identifier.
static java.lang.String getPreferredTimeZone(java.lang.String username)
          Returns the given user's preferred time zone identifier.
static java.util.TimeZone getUserTimeZone()
          Gets the current user's preferred time zone (as a TimeZone object).
static java.util.TimeZone getUserTimeZone(java.lang.String username)
          Gets the given user's preferred time zone (as a TimeZone object).
static java.lang.String getUserTimeZonePref()
          Returns the current user's time zone identifier preference value.
static java.lang.String getUserTimeZonePref(java.lang.String username)
          Returns the given user's time zone identifier preference value.
static void setDefaultTimeZone(java.lang.String timezone)
          Sets the application's time zone identifier.
static void setPreferredTimeZone(java.lang.String timezone)
          Deprecated. replaced by setUserTimeZonePref()
static void setPreferredTimeZone(java.lang.String username, java.lang.String timezone)
          Deprecated. replaced by setUserTimeZonePref()
static void setUserTimeZone(java.lang.String username, java.util.TimeZone timezone)
          Sets the given user's preferred time zone (as a TimeZone object).
static void setUserTimeZone(java.util.TimeZone timezone)
          Sets the current user's preferred time zone (as a TimeZone object).
static void setUserTimeZonePref(java.lang.String timezone)
          Set the current user's preferred time zone identifier.
static void setUserTimeZonePref(java.lang.String username, java.lang.String timezone)
          Sets the given user's preferred time zone identifier.

 

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

TIME_ZONE_KEY

public static final java.lang.String TIME_ZONE_KEY
The internal preference key to store the time zone preference.
See Also:
Constant Field Values

DEFAULT_TIMEZONE_ID

public static java.lang.String DEFAULT_TIMEZONE_ID
The time zone used if the user does not set a time zone preference. This default time zone is 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 in the format GMT{+|-}hh:mi, for example, GMT+05:30 or GMT-08:00. This identifier enables you to create a java.util.TimeZone object as follows :-
TimeZone.getTimeZone("GMT+05:30");

Returns:
the current user's preferred time zone identifier

getPreferredTimeZone

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

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

Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
the given user's preferred time zone identifier

getUserTimeZonePref

public static java.lang.String getUserTimeZonePref()
Returns the current user's time zone identifier preference value. If the user's preference is not set, returns null. This API is designed to be used in a user preference setting UI, for all other uses, the getPreferredTimeZone() API should be used.

The time zone identifier is returned in the format GMT{+|-}hh:mi, for example, GMT+05:30 or GMT-08:00.

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

getUserTimeZonePref

public static java.lang.String getUserTimeZonePref(java.lang.String username)
Returns the given user's time zone identifier preference value. If the user's preference is not set, returns null. This API is designed to be used in a user preference setting UI, for all other uses, the getPreferredTimeZone() API should be used.

The time zone identifier is returned in the format GMT{+|-}hh:mi, for example, GMT+05:30 or GMT-08:00.

Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
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 username,
                                        java.lang.String timezone)
Deprecated. replaced by setUserTimeZonePref()

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:00.

Parameters:
timezone - the preferred time zone identifier

setUserTimeZonePref

public static void setUserTimeZonePref(java.lang.String username,
                                       java.lang.String timezone)
Sets the given user's preferred time zone identifier.

The time zone identifier should be in the format GMT{+|-}hh:mi, for example, GMT+05:30 or GMT-08:00.

Parameters:
username - the username to set the preference for. If null, sets the preference for the current authenticated user
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 in the format GMT{+|-}hh:mi, for example, GMT+05:30 or GMT-08:00. This identifier enables you 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)
Sets the application's time zone identifier.

The time zone identifier should be in the format GMT{+|-}hh:mi, for example, GMT+05:30 or GMT-08:00.

Parameters:
timezone - the preferred time zone identifier

getUserTimeZone

public static java.util.TimeZone getUserTimeZone()
Gets the current user's preferred time zone (as a TimeZone object).
Returns:
the current user's preferred time zone

getUserTimeZone

public static java.util.TimeZone getUserTimeZone(java.lang.String username)
Gets the given user's preferred time zone (as a TimeZone object).
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
the given user's preferred time zone

setUserTimeZone

public static void setUserTimeZone(java.util.TimeZone timezone)
Sets the current user's preferred time zone (as a TimeZone object).
Parameters:
timezone - the time zone to set

setUserTimeZone

public static void setUserTimeZone(java.lang.String username,
                                   java.util.TimeZone timezone)
Sets the given user's preferred time zone (as a TimeZone object).
Parameters:
username - the username to set the preference for. If null, sets the preference for the current authenticated user
timezone - the time zone to set

getCurrentTime

public static java.util.Calendar getCurrentTime()
Get the current time as a Calendar object based on the current user's timezone setting.
Returns:
the current time for the current user

getCurrentTime

public static java.util.Calendar getCurrentTime(java.lang.String username)
Gets the current time as a Calendar object based on the given user's timezone setting.
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
the current time for the given user

getMidnightToday

public static java.util.Calendar getMidnightToday()
Gets the Calendar object representing the midnight hour for the current date irrespective of the current time. For example if the current time based on the current user's timezone is 14:00 on 31st May 2007, this method will return '00:00 31th May 2007'.

getMidnightToday

public static java.util.Calendar getMidnightToday(java.lang.String username)
Gets the Calendar object representing the midnight hour for the current date irrespective of the current time. For example if the current time based on the current user's timezone is 14:00 on 24th April 2009, this method will return '00:00 24th April 2009'.

getMidnightOffset

public static int getMidnightOffset()
Returns the number of minutes since midnight based on the current user's timezone setting. For example, at 04:00, this method returns 240 (4 hours x 60).
Returns:
number of minutes since midnight

getMidnightOffset

public static int getMidnightOffset(java.lang.String username)
Returns the number of minutes since midnight based on the given user's timezone setting. For example, at 04:00, this method returns 240 (4 hours x 60).
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
number of minutes since midnight

getMidnightYesterdayOffset

public static int getMidnightYesterdayOffset()
Returns the number of minutes since midnight of the previous night based on the current user's timezone setting. For example, at 04:00, this method returns 1680 (4 hours x 60 + 24 hours x 60).
Returns:
number of minutes since midnight yesterday

getMidnightYesterdayOffset

public static int getMidnightYesterdayOffset(java.lang.String username)
Returns the number of minutes since midnight of the previous night based on the given user's timezone setting. For example, at 04:00, this method returns 1680 (4 hours x 60 + 24 hours x 60).
Parameters:
username - the username to obtain the preference for. If null, obtains the preference for the current authenticated user
Returns:
number of minutes since midnight yesterday

getGMTTime

public static java.util.Calendar getGMTTime()
Returns a Calendar object representing the current time at the Greenwich Meridian (time zone GMT+00:00).
Returns:
a Calendar object representing the current time in timezone GMT+00:00

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.