This is an automated email from the ASF dual-hosted git repository. michallenc pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit b029862b3e10ae19620632acf296cdf3da6302ce Author: Marco Casaroli <[email protected]> AuthorDate: Tue Oct 20 17:44:19 2026 +0200 Documentation: Describe how localtime() finds the local time zone. The zoneinfo page now tells the order: TZ, then the file CONFIG_LIBC_TZDEFAULT, then UTC, with the settings for the IANA layout (/usr/share/zoneinfo and /etc/localtime). Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- Documentation/os/libs/libc/zoneinfo.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/os/libs/libc/zoneinfo.rst b/Documentation/os/libs/libc/zoneinfo.rst index e79da8818ee..4f00f0c157f 100644 --- a/Documentation/os/libs/libc/zoneinfo.rst +++ b/Documentation/os/libs/libc/zoneinfo.rst @@ -17,6 +17,23 @@ CONFIG_LIBC_LOCALTIME. This logic in this directory does the following: - It will then, optionally, build a ROMFS filesystem image containing the data base. +The Local Time Zone +=================== + +localtime() and tzset() take the local time zone from the environment +variable TZ: a file name in CONFIG_LIBC_TZDIR (for example +``TZ=Europe/Rome``), an absolute path, or a POSIX rule such as +``TZ=CET-1CEST,M3.5.0,M10.5.0/3``. When TZ is not set, they read the file +CONFIG_LIBC_TZDEFAULT, an absolute path or a name in CONFIG_LIBC_TZDIR. A +system with the IANA layout of the TZ database uses:: + + CONFIG_LIBC_TZDIR="/usr/share/zoneinfo" + CONFIG_LIBC_TZDEFAULT="/etc/localtime" + +where ``/etc/localtime`` is a link to the file of the local zone. When +CONFIG_LIBC_TZDEFAULT is empty (the default), or the file cannot be read, +the local time without TZ is UTC. + Creating and Mounting a ROMFS TZ Database =========================================
