Parsing and Displaying Date and Time Data

When Uniface parses the value of a Date, Time, or Dateline field, it uses either Classic mode or NLS mode, as determined by the $nlslocale and $nlsformat variables.

In Classic mode, the classic Uniface parser is used. (This is the only parser that was available prior to Uniface 9.4.) It is more flexible in handling dates that are incomplete or incorrectly formatted than the ICU parser that is used in NLS mode. You may therefore want to override the value of $nlslocale when parsing or displaying date and time fields. To do so, you can set $nlsformat or you can set the assignment settings $NLS_DATE_UNIFACE_PARSER and $NLS_DATETIME_UNIFACE_PARSER.

The value of $nlsformat overrides the value of $nlslocale when the dates and times, and numeric data are parsed and displayed, as shown in the following table.

Effect of $nlslocale and $nlsformat on Date and Time Parsing
Value of $nlslocale Value of $nlsformat
  ( Not defined ) classic nlslocale
classic Classic mode Classic mode Classic mode
system NLS mode Classic mode NLS mode
Locale NLS mode Classic mode NLS mode

$nlsformat also affects other types of numeric data, not just dates and times, so it is often preferable to set $nlsformat to nlslocale, and fine-tune date and time parsing using $NLS_DATE_UNIFACE_PARSER and $NLS_DATETIME_UNIFACE_PARSER.

The $NLS_DATE_UNIFACE_PARSER and $NLS_DATETIME_UNIFACE_PARSER settings affect the behavior of the parser, but not the format used to display the data. We therefore recommend that you always explicitly set the value of $nlsformat

Related Topics