$nlstimezonelist

Returns a list of time zones or the system time zone.

Result = $nlstimezonelist { ("system") }

Example: $valrep (TIMEZONE) = $nlstimezonelist

Parameters

Parameters

Parameter

Data Type

Description

system

String

Return the system time zone. If omitted, an associative list of time zones is returned.

Return Values

Returns an associative list of value-representation pairs for valid time zones.

Use

Allowed in all component types.

Description

You can use the $nlstimezonelist to return the current system's time zone or to populate a widget's ValRep list, enabling the user to select the local time zone.

Retrieving Time Zones on Linux

On Linux systems, $nlstimezonelist("system") may not be able return the system time zone. In this case:

  1. Check whether the variable TZ is exported with the expected system time zone.
  2. If it is not exported, add the required time zone information to this variable and export it.
  3. To ensure that it always works, add the time zone to the ~/.profile file. For example, if your required time zone is Australia/Sydney, add the following line:
    TZ='Australia/Sydney'; export TZ

It is the user's responsibility to pick and set the correct time zone. The value of the time zone can be obtained in several ways:

For more information about TZ, consult https://linux-audit.com/configure-the-time-zone-tz-on-linux-systems

History
Version Change
9.4.01 Introduced

Related Topics