From unknown Mon Jun 23 11:25:15 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#26293 <26293@debbugs.gnu.org> To: bug#26293 <26293@debbugs.gnu.org> Subject: Status: GNU date program Reply-To: bug#26293 <26293@debbugs.gnu.org> Date: Mon, 23 Jun 2025 18:25:15 +0000 retitle 26293 GNU date program reassign 26293 coreutils submitter 26293 Dean Gibson AE7Q severity 26293 normal tag 26293 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 29 03:47:29 2017 Received: (at submit) by debbugs.gnu.org; 29 Mar 2017 07:47:29 +0000 Received: from localhost ([127.0.0.1]:50035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct8KH-00077v-ES for submit@debbugs.gnu.org; Wed, 29 Mar 2017 03:47:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct3JW-0005sC-5c for submit@debbugs.gnu.org; Tue, 28 Mar 2017 22:26:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ct3JP-0000OP-SL for submit@debbugs.gnu.org; Tue, 28 Mar 2017 22:26:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46383) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ct3JP-0000O3-Ok for submit@debbugs.gnu.org; Tue, 28 Mar 2017 22:26:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ct3JO-0004MF-91 for bug-coreutils@gnu.org; Tue, 28 Mar 2017 22:26:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ct3JL-0000I0-33 for bug-coreutils@gnu.org; Tue, 28 Mar 2017 22:26:14 -0400 Received: from aws.mailpen.com ([52.43.43.172]:54870) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ct3JK-0000FF-S7 for bug-coreutils@gnu.org; Tue, 28 Mar 2017 22:26:11 -0400 Received: from [172.20.70.200] (c-67-183-148-201.hsd1.wa.comcast.net [67.183.148.201]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by aws.mailpen.com (Postfix) with ESMTPSA id CEFFC60CED; Tue, 28 Mar 2017 19:26:06 -0700 (PDT) To: bug-coreutils@gnu.org From: Dean Gibson AE7Q Subject: GNU date program Message-ID: Date: Tue, 28 Mar 2017 19:26:06 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------6AFF5B9FE6F42E491A4EF7A8" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 29 Mar 2017 03:47:28 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) This is a multi-part message in MIME format. --------------6AFF5B9FE6F42E491A4EF7A8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Consider: "date -d '2017-03-28 17:12:34 + 3 hours'" In "date (coreutils) 5.2.1 (March 2004)" it gives "Tue Mar 28 20:12:34 PDT 2017". In "GNU coreutils 8.22 February 2016)" it gives "Tue Mar 28 08:12:34 PDT 2017". Both servers use /etc/localtime -> /usr/share/zoneinfo/PST8PDT If I insert "PDT" in the original string after the time, it works on both servers. Unfortunately, since the servers run in an area that is subject to daylight savings time part of the year, hard coding the 'PDT' zone in the script it was in, is not appropriate. On both servers, "date -d '2017-03-28 17:12:34 3 hours ago'" works. Is there a "3 hours ahead"-type phrase??? I have settled on "... 21 hours ago tomorrow", which works on both servers. --------------6AFF5B9FE6F42E491A4EF7A8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Consider: "date -d '2017-03-28 17:12:34 + 3 hours'"

In "date (coreutils) 5.2.1=C2=A0 (March 2004)" it gives "Tue Mar 28 20:12:34 PDT 2017".

In "GNU coreutils 8.22 February 2016)" it gives "Tue Mar 28 08:12:34 PDT 2017".

Both servers use /etc/localtime -> /usr/share/zoneinfo/PST8PDT

If I insert "PDT" in the original string after the time, it works on both servers.=C2=A0 Unfortunately, since the servers run in an area t= hat is subject to daylight savings time part of the year, hard coding the 'PDT' zone in the script it was in, is not appropriate.

On both servers, "date -d '2017-03-28 17:12:34 3 hours ago'" works.=C2= =A0 Is there a "3 hours ahead"-type phrase???

I have settled on "... 21 hours ago tomorrow", which works on both servers.

--------------6AFF5B9FE6F42E491A4EF7A8-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 29 10:18:44 2017 Received: (at 26293) by debbugs.gnu.org; 29 Mar 2017 14:18:44 +0000 Received: from localhost ([127.0.0.1]:51436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctEQt-00023d-1V for submit@debbugs.gnu.org; Wed, 29 Mar 2017 10:18:43 -0400 Received: from mail-qk0-f173.google.com ([209.85.220.173]:34043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctEQr-00023N-GZ; Wed, 29 Mar 2017 10:18:41 -0400 Received: by mail-qk0-f173.google.com with SMTP id d10so14020149qke.1; Wed, 29 Mar 2017 07:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=at+VIEKEbdsamSWAfUgR8+c3Kf2p+wGsy6YMJ8VpXZ0=; b=GRGnnG8dLwiEzpkQ2p/5YmPyK0yS63cVCJUxF6scwuYMwt6bG3Y+7/U8lu+ZD4U/Nz rQrsLhuB3Vz5t1Yizx4Z5fWwTd+M0ds44pRJoegmj1n9j0CIg7dx1eZ4PeUpcRh73W0W jf3c3aOIS1RaslSusnLDXb+GN/MHuiWZZATKdwFJa0a81NZAspUglcBV9CRs6xlUSzm5 6u87L/Dgqh3rZ0uiskjHPzshC5AMR8g1s8XR6uy7pPK0ZN4Ua9tnR+cXByUhIYk4wrUr 3mwGtnlZohRSDecJU1Th08D/eZltCmTKsUKGW+1fIC/nwO9pwpqOyXV5HLqOIKn9fojK LueA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=at+VIEKEbdsamSWAfUgR8+c3Kf2p+wGsy6YMJ8VpXZ0=; b=WGcpfJnXtI+RL1eh5mEVSh63qEPUwbEUtu1h57Ftn0s5B8OaDUr8bU6NM3HUruQ1fq mdgTFyxmxH9lsj7+GBjg6dmDltxLkhvYtn3tbm3KpLip5u9BrA4CIPUHQtL+xJBbr0Ld p2Idwi/3Cmr2eP6hfrn5sTOKxnmrTmLhuQxpiCvXHnhbv4dDQtj+ArfTNZcihiyv3s5P boOzQ/jQ1EqYQ1PHkIDuEQ9GTcUIG1MoViS4X4ihJBpwtbBvaREuwouXMadNUrfz79B6 1njaGKJHWZ45PiaiZaNwGA00Yq3Kb2bckqaxv6q20/NSiNH80uO9bdGobT8ba1WsiMiK 1ILA== X-Gm-Message-State: AFeK/H3O3Xr5tnsEg5XQhg8fkxkV/UmdxBCcJJQJZOJRwOpkxMr3rxgtt9himYb0NyqNew== X-Received: by 10.233.222.69 with SMTP id s66mr872962qkf.126.1490797115934; Wed, 29 Mar 2017 07:18:35 -0700 (PDT) Received: from ix.home (pool-100-37-92-116.nycmny.fios.verizon.net. [100.37.92.116]) by smtp.gmail.com with ESMTPSA id z4sm4979031qkc.68.2017.03.29.07.18.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Mar 2017 07:18:35 -0700 (PDT) Subject: Re: bug#26293: GNU date program Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=us-ascii From: Assaf Gordon In-Reply-To: Date: Wed, 29 Mar 2017 10:18:33 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <335E7F37-1143-4C82-8A21-AB7A30E07EF9@gmail.com> References: To: Dean Gibson AE7Q X-Mailer: Apple Mail (2.2102) X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 26293 Cc: 26293@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) tags 26293 notabug close 26293 stop Hello, > On Mar 28, 2017, at 22:26, Dean Gibson AE7Q = wrote: >=20 > Consider: "date -d '2017-03-28 17:12:34 + 3 hours'" Due to the way date strings are parsed, the "+3" part is used as the = input time zone (+03:00) and then the "hours" part is taken as adding = one hour. > If I insert "PDT" in the original string after the time, it works on = both servers. Yes, once the parser sees an explicit timezone (PDT), it deduces the = rest is a relative time ("+3 hours"). > On both servers, "date -d '2017-03-28 17:12:34 3 hours ago'" works. Is = there a "3 hours ahead"-type phrase??? Yes, simply writing "3 hours" means "3 hours ahead". Additionally, The 'date' command in coreutils 8.27 has a new "--debug" option that = displays details about the parsed string, helping in diagnosing such issues. Compare the following examples: "+3" treated as timezone: $ date --debug -d '2017-03-28 17:12:34 + 3 hours' date: parsed date part: (Y-M-D) 2017-03-28 date: parsed time part: 17:12:34 TZ=3D+03:00 date: parsed relative part: +1 hour(s) date: input timezone: +03:00 (set from parsed date/time string) ... Adding "PDT" works, but not the desired solution: $ date --debug -d '2017-03-28 17:12:34 PDT + 3 hours' date: parsed date part: (Y-M-D) 2017-03-28 date: parsed time part: 17:12:34 date: parsed zone part: TZ=3D-07:00 date: parsed relative part: +3 hour(s) date: input timezone: -07:00 (set from parsed date/time string) ... "3 hours" works: $ date --debug -d '2017-03-28 17:12:34 3 hours' date: parsed date part: (Y-M-D) 2017-03-28 date: parsed time part: 17:12:34 date: parsed relative part: +3 hour(s) ... I'm marking this as "not-a-bug", but the discussion can continue by replying to this thread. regards, - assaf From unknown Mon Jun 23 11:25:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 27 Apr 2017 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator