%SYS
Format Class Reference

This class exposes the NLS properties related to Date, Time and Number formats. More...

Inheritance diagram for Format:
Collaboration diagram for Format:

Static Public Member Functions

_.Library.String GetFormatItem (_.Library.String item)
 Gets a format item from the current process context<br>
More...
 
_.Library.String SetFormatItem (_.Library.String item, _.Library.String val)
 Sets a format item in the current process context<br>
More...
 
_.Library.Boolean UseLocale (_.Library.Boolean new)
 Gets the system flag that indicates whether date/time/number. More...
 

Public Attributes

 AM
 Sufix which may optionally be appended to time values. More...
 
 DateFormat
 The DateFormat code used whenever a $ZDATE, $ZDATEH,. More...
 
 DateMaximum
 The maximum value for a date allowed in $ZDATE, $ZDATEH,. More...
 
 DateMinimum
 The minimum value for a date allowed in $ZDATE, $ZDATEH,. More...
 
 DateSeparator
 The character used to delimit the months, days, and years. More...
 
 DecimalSeparator
 The character used by the $FNUMBER function to separate. More...
 
 Locale
 This property controls the source of the formats. More...
 
 Midnight
 The suffix which may optionally be appended to time. More...
 
 MinusSign
 The character which may precede or follow a negative. More...
 
 MonthAbbr
 The abbreviations of the names of the twelve months,. More...
 
 MonthName
 The full names of the twelve months, used whenever a. More...
 
 Noon
 The suffix which may optionally be appended to time values. More...
 
 NumericGroupSeparator
 The character used to separate groups of numeric digits. More...
 
 NumericGroupSize
 The number of digits in a numeric group formatted by the. More...
 
 PM
 The suffix which may optionally be appended to time values. More...
 
 PlusSign
 The character which may optionally precede or follow a. More...
 
 TimeFormat
 The TimeFormat code used whenever a $ZDATETIME, $ZDATETIMEH,. More...
 
 TimePrecision
 The number of fractional digits displayed in a time value. More...
 
 TimeSeparator
 The character used to delimit the hours, minutes and seconds. More...
 
 WeekdayAbbr
 The abbreviations of the names of the seven days of the. More...
 
 WeekdayName
 The full names of the seven days of the week, starting. More...
 
 YearOption
 The YearOption code used whenever a $ZDATE, $ZDATEH,. More...
 

Detailed Description

This class exposes the NLS properties related to Date, Time and Number formats.

Their initial values come from the current locale defaults. Changing a property of an instantiated object affects only the current process. For more details see the documentation for $ZDATE, $ZDATEH, $FNUMBER.

For generic locale properties see <class>SYS.NLS.Locale</class>.
For system and process NLS table settings see <class>SYS.NLS.Table</class>.
For current device NLS properties see <class>SYS.NLS.Device</class>.

Member Function Documentation

◆ GetFormatItem()

_.Library.String GetFormatItem ( _.Library.String  item)
static

Gets a format item from the current process context<br>

Parameter:

  • item - item name (eg: "YEAROPTION", "DATEFORMAT")

Returns: selected item or "" in case of error

◆ SetFormatItem()

_.Library.String SetFormatItem ( _.Library.String  item,
_.Library.String  val 
)
static

Sets a format item in the current process context<br>

Parameters:

  • item - item name (eg: "YEAROPTION", "DATEFORMAT")
  • val - new value for item

Returns: previous item value or "" in case of error

◆ UseLocale()

_.Library.Boolean UseLocale ( _.Library.Boolean  new)
static

Gets the system flag that indicates whether date/time/number.

functions should use the locale format by default. Besides, if a new boolean flag is passed as an argument, the system flag is set to this new value. A system reboot or locale reload is necessary to activate the change.

Parameter: (optional)

  • new - sets locale format flag to this value (0 or 1)

Returns: previous value of the system locale format flag

Member Data Documentation

◆ AM

AM

Sufix which may optionally be appended to time values.

prior to 12 noon.

Example: "AM"  

◆ DateFormat

DateFormat

The DateFormat code used whenever a $ZDATE, $ZDATEH,.

$ZDATETIME or $ZDATETIMEH function call omits its second parameter, or specifies a second parameter value of -1.

Example: 1  

◆ DateMaximum

DateMaximum

The maximum value for a date allowed in $ZDATE, $ZDATEH,.

$ZDATETIME or $ZDATETIMEH functions.

Example: 94232 (12/30/2098)  

◆ DateMinimum

DateMinimum

The minimum value for a date allowed in $ZDATE, $ZDATEH,.

$ZDATETIME or $ZDATETIMEH functions.

Example: 1  

◆ DateSeparator

DateSeparator

The character used to delimit the months, days, and years.

of those dates which are otherwise entirely numeric.

Example: "/"  

◆ DecimalSeparator

DecimalSeparator

The character used by the $FNUMBER function to separate.

the whole part of a number from the fractional part of the number. Also used by $ZDATETIME, $ZDATETIMEH, $ZTIME and $ZTIMEH to separate the whole part of the seconds from the optional fractional part of the seconds, if any.

Example: "."  

◆ Locale

This property controls the source of the formats.



Locale="" means that the system default formats (usually US English) are in effect for the current process.

Locale="&lt;locale name&gt;" (eg: "rusw" or "csy8") means that the formats come from that locale.

This property may be changed after the object is instantiated or by passing the desired locale to New. For example:

Set fmt=##class(SYS.NLS.Format).New("jpnw")

As a convenience, the word "Current" can be used instead of a locale name in order to mean the current locale.  

◆ Midnight

Midnight

The suffix which may optionally be appended to time.

values corresponding to exactly 12 midnight.

Example: "MIDNIGHT"  

◆ MinusSign

MinusSign

The character which may precede or follow a negative.

numeric quantity formatted by the $FNUMBER function.

Example: "-"  

◆ MonthAbbr

MonthAbbr

The abbreviations of the names of the twelve months,.

used whenever a $ZDATE, $ZDATEH, $ZDATETIME or $ZDATETIMEH function call omits its MonthNameList parameter, or specifies a MonthNameList parameter value of -1, and the selected date format uses month name abbreviations (i.e., the effective DateFormat code is 0, 2, 5, 6 or 7)

Example: " Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"  

◆ MonthName

MonthName

The full names of the twelve months, used whenever a.

$ZDATE, $ZDATEH, $ZDATETIME or $ZDATETIMEH function call omits its MonthNameList parameter, or specifies a MonthNameList parameter value of -1, and the selected date format uses full month names (i.e., the effective DateFormat code is 9).

Example: " January February March April... November December"  

◆ Noon

Noon

The suffix which may optionally be appended to time values.

corresponding to exactly 12 noon.

Example: "NOON"  

◆ NumericGroupSeparator

NumericGroupSeparator

The character used to separate groups of numeric digits.

within the whole number portion of a number formatted by the $FNUMBER function.

Example: ","  

◆ NumericGroupSize

NumericGroupSize

The number of digits in a numeric group formatted by the.

$FNUMBER function.

Example: 3  

◆ PM

PM

The suffix which may optionally be appended to time values.

at or after 12 noon.

Example: "PM"  

◆ PlusSign

PlusSign

The character which may optionally precede or follow a.

non-negative numeric quantity formatted by the $FNUMBER function.

Example: "+"  

◆ TimeFormat

TimeFormat

The TimeFormat code used whenever a $ZDATETIME, $ZDATETIMEH,.

$ZTIME or $ZTIMEH function call omits its TimeFormat parameter, or specifies a TimeFormat parameter value of -1.

Example: 1  

◆ TimePrecision

TimePrecision

The number of fractional digits displayed in a time value.

whenever a $ZDATETIME or $ZTIME function call omits its Precision parameter, or specifies a Precision parameter value of -1.

Example: 0  

◆ TimeSeparator

TimeSeparator

The character used to delimit the hours, minutes and seconds.

in a time value.

Example: ":"  

◆ WeekdayAbbr

WeekdayAbbr

The abbreviations of the names of the seven days of the.

week, starting with Sunday and ending with Saturday, used whenever a $ZDATE or $ZDATEIME function call selects a date format which uses weekday name abbreviations (i.e., the effective DateFormat code is 11).

Example: " Sun Mon Tue Wed Thu Fri Sat"  

◆ WeekdayName

WeekdayName

The full names of the seven days of the week, starting.

with Sunday and ending with Saturday, used whenever a $ZDATE or $ZDATEIME function call selects a date format which uses full weekday names (i.e., the effective DateFormat code is 12).

Example: " Sunday Monday Tuesday... Friday Saturday"  

◆ YearOption

YearOption

The YearOption code used whenever a $ZDATE, $ZDATEH,.

$ZDATETIME or $ZDATETIMEH function call omits its YearOption parameter, or specifies a YearOption parameter value of -1.

Example: 0