GNU bug report logs - #14229
invalid TZ and /bin/date

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: Donald Berry <dberry@HIDDEN>; merged with #9614, #11748; dated Thu, 18 Apr 2013 20:30:02 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Merged 9614 11748 14229. Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 14229 <at> debbugs.gnu.org:


Received: (at 14229) by debbugs.gnu.org; 19 Apr 2013 21:19:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 19 17:19:29 2013
Received: from localhost ([127.0.0.1]:60735 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UTIiO-0002cG-W4
	for submit <at> debbugs.gnu.org; Fri, 19 Apr 2013 17:19:29 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:38814)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1UTIiL-0002bf-Bq
	for 14229 <at> debbugs.gnu.org; Fri, 19 Apr 2013 17:19:26 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 5626FA60001;
	Fri, 19 Apr 2013 14:14:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id isEPnzuYPPV6; Fri, 19 Apr 2013 14:14:47 -0700 (PDT)
Received: from [192.168.1.9] (pool-71-189-154-249.lsanca.fios.verizon.net
	[71.189.154.249])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id DF76939E8106;
	Fri, 19 Apr 2013 14:14:47 -0700 (PDT)
Message-ID: <5171B3C2.7080201@HIDDEN>
Date: Fri, 19 Apr 2013 14:14:42 -0700
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130329 Thunderbird/17.0.5
MIME-Version: 1.0
To: Donald Berry <dberry@HIDDEN>
Subject: Re: bug#14229: invalid TZ and /bin/date
References: <12409587.2562.1366316647253.JavaMail.dberry@HIDDEN>
	<517065BD.7030203@HIDDEN>
	<22769031.2853.1366400864361.JavaMail.dberry@HIDDEN>
In-Reply-To: <22769031.2853.1366400864361.JavaMail.dberry@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.2 (--)
X-Debbugs-Envelope-To: 14229
Cc: 14229 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.9 (----)

On 04/19/2013 12:47 PM, Donald Berry wrote:
> Are there any plans to reject invalid strings?

Not as far as I know.




Information forwarded to bug-coreutils@HIDDEN:
bug#14229; Package coreutils. Full text available.

Message received at 14229 <at> debbugs.gnu.org:


Received: (at 14229) by debbugs.gnu.org; 19 Apr 2013 21:11:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 19 17:11:47 2013
Received: from localhost ([127.0.0.1]:60724 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UTIav-0002Dp-PE
	for submit <at> debbugs.gnu.org; Fri, 19 Apr 2013 17:11:46 -0400
Received: from mx1.redhat.com ([209.132.183.28]:33184)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <P@HIDDEN>) id 1UTIat-0002DZ-AI
	for 14229 <at> debbugs.gnu.org; Fri, 19 Apr 2013 17:11:44 -0400
Received: from int-mx12.intmail.prod.int.phx2.redhat.com
	(int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3JL75Gj025933
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <14229 <at> debbugs.gnu.org>; Fri, 19 Apr 2013 17:07:06 -0400
Received: from [10.36.116.21] (ovpn-116-21.ams2.redhat.com [10.36.116.21])
	by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id r3JL71XQ021411
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Fri, 19 Apr 2013 17:07:03 -0400
Message-ID: <51707780.5070808@HIDDEN>
Date: Thu, 18 Apr 2013 15:45:20 -0700
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130110 Thunderbird/17.0.2
MIME-Version: 1.0
To: Donald Berry <dberry@HIDDEN>
Subject: Re: bug#14229: invalid TZ and /bin/date
References: <12409587.2562.1366316647253.JavaMail.dberry@HIDDEN>
In-Reply-To: <12409587.2562.1366316647253.JavaMail.dberry@HIDDEN>
X-Enigmail-Version: 1.5.1
Content-Type: text/plain; charset=UTF-8
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	r3JL75Gj025933
X-Spam-Score: -5.9 (-----)
X-Debbugs-Envelope-To: 14229
Cc: 14229 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.9 (-----)

On 04/18/2013 01:24 PM, Donald Berry wrote:
> If an invalid TZ argument is passed to /bin/date, it silently fails but=
 prints the UTC result:
> [dberry@dberry ~]$ TZ=3DEDT date -d @0
> Thu Jan  1 00:00:00 EDT 1970
> [dberry@dberry ~]$ TZ=3Dfoo date -d @0
> Thu Jan  1 00:00:00 foo 1970
>=20
> It works correctly if using no argument or a valid argument:
> [dberry@dberry ~]$ date -d @0
> Wed Dec 31 19:00:00 EST 1969
> [dberry@dberry ~]$ TZ=3DEST5EDT date -d @0
> Wed Dec 31 19:00:00 EST 1969
> [dberry@dberry ~]$ TZ=3DUTC date -d @0
> Thu Jan  1 00:00:00 UTC 1970
>=20
> [dberry@dberry ~]$ rpm -q coreutils
> coreutils-8.4-19.el6.x86_64
> [dberry@dberry ~]$ uname -a
> Linux dberry.csb 2.6.32-279.19.1.el6.x86_64 #1 SMP Sat Nov 24 14:35:28 =
EST 2012 x86_64 x86_64 x86_64 GNU/Linux
> [dberry@dberry ~]$ cat /etc/redhat-release=20
> Red Hat Enterprise Linux Workstation release 6.3 (Santiago)
> [dberry@dberry ~]$ date
> Thu Apr 18 16:23:46 EDT 2013

This is really annoying and confusing.
However as I understand it, there is no interface currently
that coreutils can use, to determine that a match wasn't found.
All I can recommend is to use location based zone instead
which have less scope for mismatches:
http://www.pixelbeat.org/docs/linux_timezones/

thanks,
P=C3=A1draig.




Information forwarded to bug-coreutils@HIDDEN:
bug#14229; Package coreutils. Full text available.

Message received at 14229 <at> debbugs.gnu.org:


Received: (at 14229) by debbugs.gnu.org; 19 Apr 2013 20:28:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 19 16:28:39 2013
Received: from localhost ([127.0.0.1]:60668 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UTHvB-0008WT-Iq
	for submit <at> debbugs.gnu.org; Fri, 19 Apr 2013 16:28:38 -0400
Received: from smtp.gentoo.org ([140.211.166.183]:42006)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <vapier@HIDDEN>) id 1UTHv8-0008WE-Q9
	for 14229 <at> debbugs.gnu.org; Fri, 19 Apr 2013 16:28:36 -0400
Received: from vapier.localnet (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id 6A69F33DECC;
	Fri, 19 Apr 2013 20:23:57 +0000 (UTC)
From: Mike Frysinger <vapier@HIDDEN>
Organization: wh0rd.org
To: bug-coreutils@HIDDEN
Subject: Re: bug#14229: invalid TZ and /bin/date
Date: Fri, 19 Apr 2013 16:26:18 -0400
User-Agent: KMail/1.13.7 (Linux/3.8.3; KDE/4.6.5; x86_64; ; )
References: <12409587.2562.1366316647253.JavaMail.dberry@HIDDEN>
	<517065BD.7030203@HIDDEN>
	<22769031.2853.1366400864361.JavaMail.dberry@HIDDEN>
In-Reply-To: <22769031.2853.1366400864361.JavaMail.dberry@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart28481848.jaT8BG9ET4";
	protocol="application/pgp-signature"; micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <201304191626.20366.vapier@HIDDEN>
X-Spam-Score: -4.9 (----)
X-Debbugs-Envelope-To: 14229
Cc: Paul Eggert <eggert@HIDDEN>, Donald Berry <dberry@HIDDEN>,
	14229 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -7.6 (-------)

--nextPart28481848.jaT8BG9ET4
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable

On Friday 19 April 2013 15:47:46 Donald Berry wrote:
> Yes, date/GNU accepts whatever TZ string you pass it without error, but
> this leads to very confusing results.
Paul said the "GNU system", not "GNU/date".  coreutils doesn't parse the TZ=
=20
env var, the C library does.  similarly, the date program doesn't do the ti=
me=20
parsing, it relies on the C library to handle these details.  your use of=20
`date` here is just the simplest way from the command line to test the C=20
library.  you can write C code that calls the timezone funcs and see the sa=
me=20
behavior.

> Is there any documentation of what the supported/recognized TZ strings ar=
e?
>  Are there any plans to reject invalid strings?

in the GNU system, that means glibc does the parsing.  so review the glibc=
=20
manual for details:
http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
=2Dmike

--nextPart28481848.jaT8BG9ET4
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQIcBAABAgAGBQJRcahsAAoJEEFjO5/oN/WBCnsP/0xlkdwGRF3se/oG8/ez+O2/
RoEe/u1IgzzJ9YzbDa2dPBeJWCS8ej9Ao2bfcAvomBPdR3mrjHJlwiefkfMkFdTy
gLh8WZUofyt8dQg8JR8Sw35VOO8OyWjn7svcmXEAm5MK3DFMdKqXGM+2l5iWlp3Y
q4W28zatQtUNQqoguVbXhlQ7dmlLei1jIpQ49oExa70ouRWBEFY4UIauD+W9Qbw+
mGuwaTjzDS0Od/hmWouRRhneixH4eFEAvZ/9vdNrAKyKN638p6v8iVZye1pwdwK1
p28i7BeUKMJ5En3hH1Hs/lGhQ+SeXZHLiYMzrrGGcf3c7jxmempD3Tos858oZpzR
u3Mb9zzywVnghYH86hRzkzuw4GsjWhlIvFvU3Qrqjpm0z5S7g7FSxwNc+CLAXKEH
53LjV2ItQ75YSXjotPEOl+l/RfNosJa6e/1KfRQS5Cz+4FooTlzLbQeDh/mWlZR9
Xi2au4iAZBBRLGyXfPIVxHDdn9rbdpAeq4Wf4vbnuO4rBCymOmdNHwkm6k97BWPa
qs52qAU3PuMq/LyeczSrJAFVv1LWphjtMOxX0dcGXVhPP4z4QaKwir0kxuahNzP4
BYKWHtUazxbI/9Mz0LAwCK0qtmvJjK0pGdXIqjOmauoBPwm9vFcahyIutbyfkt60
4ax7J4/b9BnMNBLFxSDL
=rqSs
-----END PGP SIGNATURE-----

--nextPart28481848.jaT8BG9ET4--




Information forwarded to bug-coreutils@HIDDEN:
bug#14229; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 19 Apr 2013 20:28:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 19 16:28:43 2013
Received: from localhost ([127.0.0.1]:60672 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UTHvG-00005B-M7
	for submit <at> debbugs.gnu.org; Fri, 19 Apr 2013 16:28:42 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40576)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <vapier@HIDDEN>) id 1UTHvC-00004s-Hs
	for submit <at> debbugs.gnu.org; Fri, 19 Apr 2013 16:28:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1UTHqj-00053g-Mb
	for submit <at> debbugs.gnu.org; Fri, 19 Apr 2013 16:24:02 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-107.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 
	RP_MATCHES_RCVD,
	USER_IN_WHITELIST autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:44847)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1UTHqj-00053c-K1
	for submit <at> debbugs.gnu.org; Fri, 19 Apr 2013 16:24:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51938)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1UTHqi-00049U-DB
	for bug-coreutils@HIDDEN; Fri, 19 Apr 2013 16:24:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1UTHqh-00053O-GU
	for bug-coreutils@HIDDEN; Fri, 19 Apr 2013 16:24:00 -0400
Received: from smtp.gentoo.org ([140.211.166.183]:54195)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1UTHqh-00053K-AB
	for bug-coreutils@HIDDEN; Fri, 19 Apr 2013 16:23:59 -0400
Received: from vapier.localnet (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id 6A69F33DECC;
	Fri, 19 Apr 2013 20:23:57 +0000 (UTC)
From: Mike Frysinger <vapier@HIDDEN>
Organization: wh0rd.org
To: bug-coreutils@HIDDEN
Subject: Re: bug#14229: invalid TZ and /bin/date
Date: Fri, 19 Apr 2013 16:26:18 -0400
User-Agent: KMail/1.13.7 (Linux/3.8.3; KDE/4.6.5; x86_64; ; )
References: <12409587.2562.1366316647253.JavaMail.dberry@HIDDEN>
	<517065BD.7030203@HIDDEN>
	<22769031.2853.1366400864361.JavaMail.dberry@HIDDEN>
In-Reply-To: <22769031.2853.1366400864361.JavaMail.dberry@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart28481848.jaT8BG9ET4";
	protocol="application/pgp-signature"; micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <201304191626.20366.vapier@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -6.1 (------)
X-Debbugs-Envelope-To: submit
Cc: Paul Eggert <eggert@HIDDEN>, Donald Berry <dberry@HIDDEN>,
	14229 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.1 (------)

--nextPart28481848.jaT8BG9ET4
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable

On Friday 19 April 2013 15:47:46 Donald Berry wrote:
> Yes, date/GNU accepts whatever TZ string you pass it without error, but
> this leads to very confusing results.
Paul said the "GNU system", not "GNU/date".  coreutils doesn't parse the TZ=
=20
env var, the C library does.  similarly, the date program doesn't do the ti=
me=20
parsing, it relies on the C library to handle these details.  your use of=20
`date` here is just the simplest way from the command line to test the C=20
library.  you can write C code that calls the timezone funcs and see the sa=
me=20
behavior.

> Is there any documentation of what the supported/recognized TZ strings ar=
e?
>  Are there any plans to reject invalid strings?

in the GNU system, that means glibc does the parsing.  so review the glibc=
=20
manual for details:
http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
=2Dmike

--nextPart28481848.jaT8BG9ET4
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQIcBAABAgAGBQJRcahsAAoJEEFjO5/oN/WBCnsP/0xlkdwGRF3se/oG8/ez+O2/
RoEe/u1IgzzJ9YzbDa2dPBeJWCS8ej9Ao2bfcAvomBPdR3mrjHJlwiefkfMkFdTy
gLh8WZUofyt8dQg8JR8Sw35VOO8OyWjn7svcmXEAm5MK3DFMdKqXGM+2l5iWlp3Y
q4W28zatQtUNQqoguVbXhlQ7dmlLei1jIpQ49oExa70ouRWBEFY4UIauD+W9Qbw+
mGuwaTjzDS0Od/hmWouRRhneixH4eFEAvZ/9vdNrAKyKN638p6v8iVZye1pwdwK1
p28i7BeUKMJ5En3hH1Hs/lGhQ+SeXZHLiYMzrrGGcf3c7jxmempD3Tos858oZpzR
u3Mb9zzywVnghYH86hRzkzuw4GsjWhlIvFvU3Qrqjpm0z5S7g7FSxwNc+CLAXKEH
53LjV2ItQ75YSXjotPEOl+l/RfNosJa6e/1KfRQS5Cz+4FooTlzLbQeDh/mWlZR9
Xi2au4iAZBBRLGyXfPIVxHDdn9rbdpAeq4Wf4vbnuO4rBCymOmdNHwkm6k97BWPa
qs52qAU3PuMq/LyeczSrJAFVv1LWphjtMOxX0dcGXVhPP4z4QaKwir0kxuahNzP4
BYKWHtUazxbI/9Mz0LAwCK0qtmvJjK0pGdXIqjOmauoBPwm9vFcahyIutbyfkt60
4ax7J4/b9BnMNBLFxSDL
=rqSs
-----END PGP SIGNATURE-----

--nextPart28481848.jaT8BG9ET4--




Information forwarded to bug-coreutils@HIDDEN:
bug#14229; Package coreutils. Full text available.

Message received at 14229 <at> debbugs.gnu.org:


Received: (at 14229) by debbugs.gnu.org; 19 Apr 2013 19:52:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 19 15:52:36 2013
Received: from localhost ([127.0.0.1]:60638 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UTHMK-0006qY-EF
	for submit <at> debbugs.gnu.org; Fri, 19 Apr 2013 15:52:36 -0400
Received: from mx4-phx2.redhat.com ([209.132.183.25]:54741)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <dberry@HIDDEN>) id 1UTHMG-0006q9-AO
	for 14229 <at> debbugs.gnu.org; Fri, 19 Apr 2013 15:52:34 -0400
Received: from zmail19.collab.prod.int.phx2.redhat.com
	(zmail19.collab.prod.int.phx2.redhat.com [10.5.83.22])
	by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3JJlk4I005785;
	Fri, 19 Apr 2013 15:47:46 -0400
Date: Fri, 19 Apr 2013 15:47:46 -0400 (EDT)
From: Donald Berry <dberry@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Message-ID: <22769031.2853.1366400864361.JavaMail.dberry@HIDDEN>
In-Reply-To: <517065BD.7030203@HIDDEN>
References: <12409587.2562.1366316647253.JavaMail.dberry@HIDDEN>
	<517065BD.7030203@HIDDEN>
Subject: Re: bug#14229: invalid TZ and /bin/date
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.5.82.12]
X-Mailer: Zimbra 8.0.3_GA_5664 (Zimbra Desktop/7.2.2_11951_Linux)
Thread-Topic: bug#14229: invalid TZ and /bin/date
Thread-Index: FCQppVimP3bExsjBqzvAb2r5782fGA==
X-Spam-Score: -4.9 (----)
X-Debbugs-Envelope-To: 14229
Cc: 14229 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -7.6 (-------)

Yes, date/GNU accepts whatever TZ string you pass it without error, but this leads to very confusing results.  Here again is one of the examples:

[dberry <at> dberry ~]$ TZ=foo date -d @0
Thu Jan  1 00:00:00 foo 1970

I think it is safe to say that 'foo' is not a valid timezone, and yet date returns the UTC result, but displays it as timezone foo.

Even more confusing is using a string that the user may think is valid, such as EDT.  Again date returns the UTC result, but displays it as timezone EDT.

[dberry <at> dberry ~]$ TZ=EDT date -d @0
Thu Jan  1 00:00:00 EDT 1970

It seems that when date does not understand the string it returns the UTC result, but echoes the string back as the apparent timezone, or at least attempts to - date has a limit on the number of characters it supports:

[dberry@dberry ~]$ TZ=America/Eastern date -d @0 # invalid TZ string
Thu Jan  1 00:00:00 America 1970

There are other strings that date does understand, and in fact translates them into another timezone in the output, e.g.:

[dberry@dberry ~]$ TZ=America/Phoenix date -d @0
Wed Dec 31 17:00:00 MST 1969

Is there any documentation of what the supported/recognized TZ strings are?  Are there any plans to reject invalid strings?  I did see there was a similar bug reported in 2011 (http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9614).  

Don

----- Original Message -----
From: "Paul Eggert" <eggert@HIDDEN>
To: "Donald Berry" <dberry@HIDDEN>
Cc: 14229 <at> debbugs.gnu.org
Sent: Thursday, April 18, 2013 5:29:33 PM
Subject: Re: bug#14229: invalid TZ and /bin/date

On 04/18/13 13:24, Donald Berry wrote:
> If an invalid TZ argument is passed to /bin/date,
> it silently fails but prints the UTC result

In the GNU system there is no such thing
as an invalid TZ string.  Every TZ string has
some interpretation (typically as UTC).
This is true not just for /bin/date, but for
every other program.





Information forwarded to bug-coreutils@HIDDEN:
bug#14229; Package coreutils. Full text available.

Message received at 14229 <at> debbugs.gnu.org:


Received: (at 14229) by debbugs.gnu.org; 18 Apr 2013 21:34:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 18 17:34:09 2013
Received: from localhost ([127.0.0.1]:59237 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1USwT2-0002aH-RV
	for submit <at> debbugs.gnu.org; Thu, 18 Apr 2013 17:34:09 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:36400)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1USwT0-0002a9-Cv
	for 14229 <at> debbugs.gnu.org; Thu, 18 Apr 2013 17:34:07 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 614B539E8105;
	Thu, 18 Apr 2013 14:29:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id QTdc8kR+crs8; Thu, 18 Apr 2013 14:29:34 -0700 (PDT)
Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 1B47A39E8008;
	Thu, 18 Apr 2013 14:29:34 -0700 (PDT)
Message-ID: <517065BD.7030203@HIDDEN>
Date: Thu, 18 Apr 2013 14:29:33 -0700
From: Paul Eggert <eggert@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130311 Thunderbird/17.0.4
MIME-Version: 1.0
To: Donald Berry <dberry@HIDDEN>
Subject: Re: bug#14229: invalid TZ and /bin/date
References: <12409587.2562.1366316647253.JavaMail.dberry@HIDDEN>
In-Reply-To: <12409587.2562.1366316647253.JavaMail.dberry@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.2 (--)
X-Debbugs-Envelope-To: 14229
Cc: 14229 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.5 (---)

On 04/18/13 13:24, Donald Berry wrote:
> If an invalid TZ argument is passed to /bin/date,
> it silently fails but prints the UTC result

In the GNU system there is no such thing
as an invalid TZ string.  Every TZ string has
some interpretation (typically as UTC).
This is true not just for /bin/date, but for
every other program.





Information forwarded to bug-coreutils@HIDDEN:
bug#14229; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Apr 2013 20:30:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 18 16:30:00 2013
Received: from localhost ([127.0.0.1]:59155 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1USvSw-00004q-2F
	for submit <at> debbugs.gnu.org; Thu, 18 Apr 2013 16:29:59 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56675)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <dberry@HIDDEN>) id 1USvRq-0008Ta-4t
	for submit <at> debbugs.gnu.org; Thu, 18 Apr 2013 16:28:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <dberry@HIDDEN>) id 1USvNR-0001mI-9u
	for submit <at> debbugs.gnu.org; Thu, 18 Apr 2013 16:24:19 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,
	RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:47273)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dberry@HIDDEN>) id 1USvNR-0001mE-7x
	for submit <at> debbugs.gnu.org; Thu, 18 Apr 2013 16:24:17 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39777)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dberry@HIDDEN>) id 1USvNN-0000wc-P6
	for bug-coreutils@HIDDEN; Thu, 18 Apr 2013 16:24:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <dberry@HIDDEN>) id 1USvNL-0001lK-6P
	for bug-coreutils@HIDDEN; Thu, 18 Apr 2013 16:24:13 -0400
Received: from mx3-phx2.redhat.com ([209.132.183.24]:60230)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dberry@HIDDEN>) id 1USvNK-0001lD-Ms
	for bug-coreutils@HIDDEN; Thu, 18 Apr 2013 16:24:11 -0400
Received: from zmail19.collab.prod.int.phx2.redhat.com
	(zmail19.collab.prod.int.phx2.redhat.com [10.5.83.22])
	by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3IKO9ut002274
	for <bug-coreutils@HIDDEN>; Thu, 18 Apr 2013 16:24:09 -0400
Date: Thu, 18 Apr 2013 16:24:08 -0400 (EDT)
From: Donald Berry <dberry@HIDDEN>
To: bug-coreutils@HIDDEN
Message-ID: <12409587.2562.1366316647253.JavaMail.dberry@HIDDEN>
In-Reply-To: <28051121.2559.1366316439841.JavaMail.dberry@HIDDEN>
Subject: invalid TZ and /bin/date
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.5.82.12]
X-Mailer: Zimbra 8.0.3_GA_5664 (Zimbra Desktop/7.2.2_11951_Linux)
Thread-Topic: invalid TZ and /bin/date
Thread-Index: b8w79JvZpqgMC02iYFd+ueoN1ojDbQ==
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 18 Apr 2013 16:29:56 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

If an invalid TZ argument is passed to /bin/date, it silently fails but prints the UTC result:
[dberry@dberry ~]$ TZ=EDT date -d @0
Thu Jan  1 00:00:00 EDT 1970
[dberry@dberry ~]$ TZ=foo date -d @0
Thu Jan  1 00:00:00 foo 1970

It works correctly if using no argument or a valid argument:
[dberry@dberry ~]$ date -d @0
Wed Dec 31 19:00:00 EST 1969
[dberry@dberry ~]$ TZ=EST5EDT date -d @0
Wed Dec 31 19:00:00 EST 1969
[dberry@dberry ~]$ TZ=UTC date -d @0
Thu Jan  1 00:00:00 UTC 1970

[dberry@dberry ~]$ rpm -q coreutils
coreutils-8.4-19.el6.x86_64
[dberry@dberry ~]$ uname -a
Linux dberry.csb 2.6.32-279.19.1.el6.x86_64 #1 SMP Sat Nov 24 14:35:28 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
[dberry@dberry ~]$ cat /etc/redhat-release 
Red Hat Enterprise Linux Workstation release 6.3 (Santiago)
[dberry@dberry ~]$ date
Thu Apr 18 16:23:46 EDT 2013

Donald Berry, RHCE
Technical Account Manager
Red Hat Canada Ltd.
mobile: 647-338-6329





Acknowledgement sent to Donald Berry <dberry@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#14229; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 15 Oct 2018 23:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.