From 4e00a0b860319de5ee7fde21524991ce7e8391f7 Mon Sep 17 00:00:00 2001 From: JWP Date: Sun, 18 Jan 2015 15:00:07 -0500 Subject: [PATCH] tzset.3: Filespec omitted incorrect Paragraph three of the DESCRIPTION section says that when TZ is set, but empty, then UTC is used. Later it says if the TZ filespec is omitted then the file /usr/share/zoneinfo/localtime is used. This is incorrect, it will use UTC in that case as well. Steps to reproduce: cd /usr/share/zoneinfo/ cp Antarctica/South_Pole localtime cd date Sun Jan 18 10:59:50 EST 2015 TZ=:Hongkong date Sun Jan 18 23:59:56 HKT 2015 TZ=:/usr/share/zoneinfo/localtime date Mon Jan 19 05:00:03 NZDT 2015 TZ=: date Sun Jan 18 16:00:11 UTC 2015 TZ=":" date Sun Jan 18 16:00:18 UTC 2015 TZ=':' date Sun Jan 18 16:00:24 UTC 2015 TZ=:/ date Sun Jan 18 16:00:34 2015 TZ=":/" date Sun Jan 18 16:00:40 2015 TZ="" date Sun Jan 18 16:00:45 UTC 2015 Signed-off-by: J William Piggott Signed-off-by: Michael Kerrisk --- man3/tzset.3 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/man3/tzset.3 b/man3/tzset.3 index c1c98e17b..36d2fd725 100644 --- a/man3/tzset.3 +++ b/man3/tzset.3 @@ -170,14 +170,8 @@ from a file: :[filespec] .RE .sp -If the file specification \fIfilespec\fP is omitted, the timezone -information is read from the file -.I localtime -in the system timezone directory, which nowadays usually is -.IR /usr/share/zoneinfo . -This file is in -.BR tzfile (5) -format. +If the file specification \fIfilespec\fP is omitted, or its value cannot +be interpreted, then Coordinated Universal Time (UTC) is used. If \fIfilespec\fP is given, it specifies another .BR tzfile (5)-format file to read the timezone information from.