public class SessionDateUtils extends java.lang.Object implements SessionExports
CommonSession
interface (or one of its super interfaces) and are not statically
implemented by the classes used by the SessionUtils.asHandle()
.Modifier and Type | Field and Description |
---|---|
static SessionDateUtils |
INSTANCE
Singleton instance
|
Modifier | Constructor and Description |
---|---|
private |
SessionDateUtils()
Private default constructor - to enforce singleton
|
Modifier and Type | Method and Description |
---|---|
character |
getDateFormat()
Gets the order of date components (SESSION:DATE-FORMAT) for conversion to/from strings.
|
integer |
getSessionDisplayTimeZone()
Obtains the currently configured DISPLAY-TIMEZONE attribute for the current
user's context.
|
character |
getSessionTimeSource()
Obtains the currently configured TIME-SOURCE attribute for the current
user's context.
|
integer |
getSessionTimeZone()
Accesses the SESSION:TIMEZONE used as the default offset in minutes from
UTC for this user's context.
|
integer |
getYearOffset()
Implementation of SESSION:YEAR-OFFSET attribute getter.
|
void |
setDateFormat(character dateFormat)
Sets the order of date components (SESSION:DATE-FORMAT) for conversion to/from strings.
|
void |
setDateFormat(java.lang.String dateFormat)
Sets the order of date components (SESSION:DATE-FORMAT) for conversion to/from strings.
|
void |
setSessionDisplayTimeZone(NumberType displayTimezone)
Sets the
DISPLAY-TIMEZONE attribute for the user's context. |
void |
setSessionTimeSource(character timeSource)
Sets the
TIME-SOURCE attribute for the user's context. |
void |
setSessionTimeZone(NumberType offset)
Sets the SESSION:TIMEZONE used as the default offset in minutes from
UTC for this user's context.
|
void |
setYearOffset(NumberType year)
Implementation of SESSION:YEAR-OFFSET attribute setter.
|
public static SessionDateUtils INSTANCE
private SessionDateUtils()
public void setDateFormat(java.lang.String dateFormat)
The order of the 3 date sub-components as a 3 character string using "M", "D" and "Y" once each. The order from index 0 to index 2 represents the left to right ordering of the components. So the leftmost date component will be defined by the character at index position 0.
The value set is specific to the current user's context.
dateFormat
- Defines the order of date components for conversion to/from strings.public void setDateFormat(character dateFormat)
The order of the 3 date sub-components as a 3 character string using "M", "D" and "Y" once each. The order from index 0 to index 2 represents the left to right ordering of the components. So the leftmost date component will be defined by the character at index position 0.
The value set is specific to the current user's context.
setDateFormat
in interface SessionExports
dateFormat
- Defines the order of date components for conversion to/from strings.public character getDateFormat()
The order of the 3 date sub-components is a 3 character string using "M", "D" and "Y" once each. The order from index 0 to index 2 represents the left to right ordering of the components. So the leftmost date component will be defined by the character at index position 0.
The value accessed is specific to the current user's context.
public void setSessionTimeZone(NumberType offset)
setSessionTimeZone
in interface SessionExports
offset
- The new timezone offset which must be between -840 and 840
inclusive. The value may also be unknown
which
is the equivalent of resetting this attribute to the default.public integer getSessionTimeZone()
unknown
will be returned.public character getSessionTimeSource()
The default value is "local" which in Progress means that the client machine is the source (this is the same as the empty string ""). It is common to use a database name in the 4GL, which makes the application use the database server as the time source.
public void setSessionTimeSource(character timeSource)
TIME-SOURCE
attribute for the user's context.
This attribute is can be read and written but it is not honored for
date/time processing in P2J. The intention of the attribute is to define
the system from which time values will be obtained. In P2J, time values
are always obtained from the application server.setSessionTimeSource
in interface SessionExports
timeSource
- The new value to set. If null
, then the empty
string will be used, which in the 4GL has the same affect as
"local".public integer getSessionDisplayTimeZone()
public void setSessionDisplayTimeZone(NumberType displayTimezone)
DISPLAY-TIMEZONE
attribute for the user's context.
This attribute is used for displaying DATETIME-TZ values that do not have
the timezone specified in the display format.setSessionDisplayTimeZone
in interface SessionExports
displayTimezone
- The new value to set.public integer getYearOffset()
date.getWindowingYear()
).public void setYearOffset(NumberType year)
date.getWindowingYear()
).setYearOffset
in interface SessionExports
year
- The new start year for the two-digit windowing range.