$nlstimezonelist
Returns a list of time zones or the system time zone.
Result =
$nlstimezonelist { ("system")
}
Example: $valrep (TIMEZONE) = $nlstimezonelist
Parameters
Parameter |
Data Type |
Description |
---|---|---|
|
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:
- Check whether the variable
TZ
is exported with the expected system time zone. - If it is not exported, add the required time zone information to this variable and export it.
- 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:
- From the list returned by $nlstimezonelist()
- From https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- On Linux, using the following command:
timedatectl list-timezones
For more information about TZ, consult https://linux-audit.com/configure-the-time-zone-tz-on-linux-systems
Version | Change |
---|---|
9.4.01 | Introduced |