$NLS_INTERNAL_TIME

Specify whether to use Coordinated Universal Time (UTC+00:00) as the internal time zone.

$NLS_INTERNAL_TIME="UTC" | "classic"

Arguments

  • UTC—sets the internal time zone to Coordinated Universal time at Greenwich (UTC+00:00), and adjusts to the external or local value when displaying or parsing date and time data in fields.
  • classic—use the local time zone; do not apply any internal to external time zone correction.

Defaults

Assignment file:

application assignment file

Section: [SETTINGS]
Default value: classic

Description

Setting the ProcScript function $nlsinternaltime overrides the value set by $NLS_INTERNAL_TIME in the assignment file (if defined).

Setting the value to classic explicitly instructs Uniface to use its default behavior, which is to use the local time as defined on the executing system. The date and time are not corrected to the external time.

Setting the value to UTC sets the internal time zone to Coordinated Universal time at Greenwich (UTC+00:00). This has the following consequences:

  • ProcScript functions $clock, $date, and $datim return the internal time
  • The internal date and time is stored and retrieved from the database
  • The internal time is used when exchanging data
  • The internal time zone is always corrected to the external time zone when displaying data.

For applications that store date or time data, it makes sense to use UTC+00:00 as the internal time zone, so that all data conforms to a standard time. For example, if you place an order at 9:00 AM in Detroit, the date is corrected to the UTC time of UTC-05:00, in other words 14:00 (2:00 PM) Greenwich Mean Time. Corrections for Daylight Savings Time (DST) are also applied. When retrieving data from the database, the UTC time is corrected to display the time according to the external time zone.

Caution: Any data that exists in the database prior to setting the internal time is assumed to be stored at GMT+00:00, so it will also be corrected to the external or local time when displayed.

UTC Conversions During DST Transitions

When the switch to or from Daylight Savings Time occurs, special rules are applied to the external time conversions. These are required to consistently handle the time that is lost when the clocks are set forward or gained when the clocks are set back.

The easiest way to understand this is with a couple of examples:

  • Assume that the clock is set forward at 02:00 by one hour, meaning that 02:00 becomes 03:00. Any time from 02:00 and before 03:00 is invalid. If you enter a time such as 02:30, it will be displayed as 03:30.

    External Time Zone Conversions when Clock is Set Forward (02:00 becomes 03:00)
    External Time‡ In UTC External Time‡ Out
    12:00 23:00 12:00
    01:00 00:00 01:00
    2:00 = 3:00 01:00 03:00
    [02:30 =] 3:30 01:30 03:30
    03:00 01:00 03:00
    03:30 01:30 03:30
    04:00 02:00 04:00
    ‡External time zone is shown with a time zone shift of UTC+1. The square brackets indicate an invalid input time.
  • Assume that the clock is set backward at 03:00 by one hour, meaning that 03:00 becomes 02:00. Now there two times, separated by an hour when it is really 02:00, once before the transition and another at the time of transition. The same is true of 03:00.

    The functions that convert from external time treat such a doubly-occurring times as if it were the second time. So when you enter 02:00 the internal time will reflect the 02:00 after the transition.

    External time zone is shown with a time zone shift of UTC+1. The square brackets indicate an invalid input time.

    External Time Zone Conversions when Clock is Set Backward (03:00 becomes 02:00)

    External Time‡ In

    UTC

    External Time‡ Out

    01:00

    23:00

    01:00

    [2:00]

    00:00

    02:00

    [ 03:00 =] 2:00

    01:00

    02:00

    02:30

    01:30

    02:30

    03:00

    02:00

    03:00

    ‡External time zone is shown with a time zone shift of UTC+1. The square brackets indicate an invalid input time.

Related Topics