From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 02:24:37 2017 Received: (at submit) by debbugs.gnu.org; 27 Jan 2017 07:24:37 +0000 Received: from localhost ([127.0.0.1]:46893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX0th-00034s-6x for submit@debbugs.gnu.org; Fri, 27 Jan 2017 02:24:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX0om-0002wS-Q1 for submit@debbugs.gnu.org; Fri, 27 Jan 2017 02:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cX0og-00025a-LQ for submit@debbugs.gnu.org; Fri, 27 Jan 2017 02:19:27 -0500 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 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35920) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cX0og-00025W-IH for submit@debbugs.gnu.org; Fri, 27 Jan 2017 02:19:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cX0of-0005Fg-Aq for bug-coreutils@gnu.org; Fri, 27 Jan 2017 02:19:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cX0oc-000239-5w for bug-coreutils@gnu.org; Fri, 27 Jan 2017 02:19:25 -0500 Received: from mail.bitwise.fi ([109.204.228.163]:39750) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cX0ob-00022Q-QM for bug-coreutils@gnu.org; Fri, 27 Jan 2017 02:19:22 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.bitwise.fi (Postfix) with ESMTP id 22B65630D6 for ; Fri, 27 Jan 2017 09:19:18 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at mail.bitwise.fi Received: from mail.bitwise.fi ([127.0.0.1]) by localhost (mail.bitwise.fi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8oSt5BXJZrCF for ; Fri, 27 Jan 2017 09:19:15 +0200 (EET) Received: from [192.168.42.18] (fw1.dmz.bitwise.fi [192.168.69.1]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: rammer) by mail.bitwise.fi (Postfix) with ESMTPSA id 9C392601CB for ; Fri, 27 Jan 2017 09:19:15 +0200 (EET) To: bug-coreutils@gnu.org From: Rami Lehti Subject: date to support iso-8601 week-format (patch included) Message-ID: <1f44a48d-96a0-cea4-5023-64b02a8df2d8@bitwise.fi> Date: Fri, 27 Jan 2017 09:19:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------10A9AFF7CB624AF4A73BABC5" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [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.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 27 Jan 2017 02:24:36 -0500 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.0 (----) This is a multi-part message in MIME format. --------------10A9AFF7CB624AF4A73BABC5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi, Currently 'date -Iweeks' does not display the ISO 8601 standard's week format. Neither does it support the ordinal format in that standard. Attached to this message you will find a patch for this issue. The patch has been made against latest git master branch. The patch itself is trivial. Please consider applying it coreutils. Kind regards, Rami Lehti --------------10A9AFF7CB624AF4A73BABC5 Content-Type: text/x-patch; name="iso-8601.weeks.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iso-8601.weeks.patch" diff --git a/src/date.c b/src/date.c index eb7c624..b6d4b21 100644 --- a/src/date.c +++ b/src/date.c @@ -52,7 +52,11 @@ enum Time_spec /* Put these last, since they aren't valid for --rfc-3339. */ - /* Display date and hour. */ + /* Display year and ordinal day number. */ + TIME_SPEC_ORDINAL, + /* Display year and week number. */ + TIME_SPEC_WEEKS, + /* Display date and hour. */ TIME_SPEC_HOURS, /* Display date, hours, and minutes. */ TIME_SPEC_MINUTES @@ -60,14 +64,14 @@ enum Time_spec static char const *const time_spec_string[] = { - /* Put "hours" and "minutes" first, since they aren't valid for - --rfc-3339. */ - "hours", "minutes", + /* Put "ordinal", "weeks", "hours" and "minutes" first, since + they aren't valid for --rfc-3339. */ + "ordinal", "weeks", "hours", "minutes", "date", "seconds", "ns", NULL }; static enum Time_spec const time_spec[] = { - TIME_SPEC_HOURS, TIME_SPEC_MINUTES, + TIME_SPEC_ORDINAL, TIME_SPEC_WEEKS, TIME_SPEC_HOURS, TIME_SPEC_MINUTES, TIME_SPEC_DATE, TIME_SPEC_SECONDS, TIME_SPEC_NS }; ARGMATCH_VERIFY (time_spec_string, time_spec); @@ -151,8 +155,9 @@ Display the current time in the given FORMAT, or set the system date.\n\ fputs (_("\ -I[FMT], --iso-8601[=FMT] output date/time in ISO 8601 format.\n\ FMT='date' for date only (the default),\n\ - 'hours', 'minutes', 'seconds', or 'ns'\n\ - for date and time to the indicated precision.\n\ + 'ordinal', 'weeks', 'hours', 'minutes',\n\ + 'seconds', or 'ns' for date and time to \n\ + the indicated precision.\n\ Example: 2006-08-14T02:34:56-06:00\n\ "), stdout); fputs (_("\ @@ -392,7 +397,7 @@ main (int argc, char **argv) }; enum Time_spec i = XARGMATCH ("--rfc-3339", optarg, - time_spec_string + 2, time_spec + 2); + time_spec_string + 4, time_spec + 4); new_format = rfc_3339_format[i]; break; } @@ -403,6 +408,8 @@ main (int argc, char **argv) "%Y-%m-%d", "%Y-%m-%dT%H:%M:%S%:z", "%Y-%m-%dT%H:%M:%S,%N%:z", + "%Y-%j", + "%G-W%V", "%Y-%m-%dT%H%:z", "%Y-%m-%dT%H:%M%:z" }; --------------10A9AFF7CB624AF4A73BABC5-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 05:34:29 2017 Received: (at 25554) by debbugs.gnu.org; 27 Jan 2017 10:34:29 +0000 Received: from localhost ([127.0.0.1]:47044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX3rR-0007ZZ-Hr for submit@debbugs.gnu.org; Fri, 27 Jan 2017 05:34:29 -0500 Received: from midir.magicbluesmoke.com ([82.195.144.46]:40732 helo=mail.magicbluesmoke.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX3rP-0007ZQ-51 for 25554@debbugs.gnu.org; Fri, 27 Jan 2017 05:34:28 -0500 Received: from [192.168.1.80] (unknown [109.76.170.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id CBF9A16B; Fri, 27 Jan 2017 10:34:25 +0000 (GMT) Subject: Re: bug#25554: date to support iso-8601 week-format (patch included) To: Rami Lehti , 25554@debbugs.gnu.org References: <1f44a48d-96a0-cea4-5023-64b02a8df2d8@bitwise.fi> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <40d9c6e2-8c1b-9376-aa05-50d02cd642eb@draigBrady.com> Date: Fri, 27 Jan 2017 10:34:25 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1f44a48d-96a0-cea4-5023-64b02a8df2d8@bitwise.fi> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 25554 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.0 (/) On 27/01/17 07:19, Rami Lehti wrote: > Hi, > > Currently 'date -Iweeks' does not display the ISO 8601 standard's week > format. Neither does it support the ordinal format in that standard. > Attached to this message you will find a patch for this issue. The patch > has been made against latest git master branch. The patch itself is > trivial. > > Please consider applying it coreutils. This looks useful thanks. I'd probably present 'day of year' to the user in --help rather than 'ordinal'. I'll add a test and NEWS. cheers, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 17:22:26 2017 Received: (at 25554) by debbugs.gnu.org; 27 Jan 2017 22:22:26 +0000 Received: from localhost ([127.0.0.1]:48631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXEuY-0005WU-3z for submit@debbugs.gnu.org; Fri, 27 Jan 2017 17:22:26 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXEuV-0005WG-PB for 25554@debbugs.gnu.org; Fri, 27 Jan 2017 17:22:24 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C4F6B1600EA; Fri, 27 Jan 2017 14:22:17 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nhoGTAd9U2-G; Fri, 27 Jan 2017 14:22:17 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0ACCE1600DA; Fri, 27 Jan 2017 14:22:17 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id fi1idBsQs-KW; Fri, 27 Jan 2017 14:22:16 -0800 (PST) Received: from [192.168.1.9] (unknown [47.153.188.248]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id D19B01600B9; Fri, 27 Jan 2017 14:22:16 -0800 (PST) Subject: Re: bug#25554: date to support iso-8601 week-format (patch included) To: Rami Lehti , 25554@debbugs.gnu.org References: <1f44a48d-96a0-cea4-5023-64b02a8df2d8@bitwise.fi> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <74e301c8-eaca-369b-d94d-b775bcc9ef5d@cs.ucla.edu> Date: Fri, 27 Jan 2017 14:22:16 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1f44a48d-96a0-cea4-5023-64b02a8df2d8@bitwise.fi> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25554 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: -3.2 (---) I dunno, there are several ISO 8601 formats that 'date -I' doesn't have a= =20 special case for now; why add these particular shorthands? If we go down = this=20 route, shouldn't we also add shorthands for %Y%j, %GW%V, %G-W%V-%u, etc.,= etc.?=20 Where will it stop? Instead, perhaps we should just suggest to people that they use ordinary = date=20 formats, as standardized by POSIX. These should be more portable anyway. = -I is=20 meant as a convenience for interactive use, and I doubt whether people wo= uld=20 want to use "date -Iweek" interactively much. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 28 03:59:55 2018 Received: (at 25554) by debbugs.gnu.org; 28 Oct 2018 07:59:55 +0000 Received: from localhost ([127.0.0.1]:46565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGfzH-0000bi-EQ for submit@debbugs.gnu.org; Sun, 28 Oct 2018 03:59:55 -0400 Received: from mail-io1-f52.google.com ([209.85.166.52]:33669) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGfzF-0000bR-Ph; Sun, 28 Oct 2018 03:59:54 -0400 Received: by mail-io1-f52.google.com with SMTP id l25-v6so3163449ioj.0; Sun, 28 Oct 2018 00:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=MdOCX4NjvN1JBfpzZAZTez1Hz2C420tuP0VnF/Qrd9w=; b=cbPjYMeqCBuSFd41shN6EzjOrRXD2R9bPnq4fzrvNQ2+mQdDFQG1beGLbpIA/9ggYM 6aPKMT1oUa21VxNwb5ZculKDZkxNDA0UMSOWGwyjFgnlqDHv5kb9EZTOQ6EesbGVDkcz JL/CPLAvHEss062jw053Jc7PbCMhI70FZp6uN3tHSuBQ6kSOZqhfZi3IHokbG86MXdtp bsWiajhEmq5XZ6lUP++y3eEBP8XzIXq/Y7FjJLywDXS9KBoKZYq0/77yhGICRFvVD3Rh t+JhyNwpwW3bPGvqAH7K5J0wdX61VIdVIj0agfC7M2zhuvq/yfmZDQwLzPaqZtsOdJ2W 7j3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MdOCX4NjvN1JBfpzZAZTez1Hz2C420tuP0VnF/Qrd9w=; b=FXQs1tAHKffdpfbKyOwW2FYD8R9lrt4s066DnDxcTzGEOahToI52ix0AGAoCMlpSKZ ITkT7D6orG4toxyMSRX24xlNqa8ZtkMqEQGW3EU+Oe/Ozjd3aj+0SlHkiVx8E4+/3c4m jkgV+ZBLlZP5GLOBm5seMZ3oeDu422l9GnoDkpPe8Q5dkcY77ONbuaPD0UqqVxVgazqQ eFNhTXiJmEvnimLM5A9KgjejO+NsRwkWBzQZ85PhP1wmcbnpeDODICovWsxbHqUzptto 7AxWUE1p0h7awj63070LvGTSKFtAm6Xxb11kLrzIVXigfNdTsmjOSkK92q18V7RvuICn qFOQ== X-Gm-Message-State: AGRZ1gLzvs1ixJcxdMUQbYEp118PdfxqcvsNJxYZZ4E0JyGJVdPsLBEX fqAclKfi4p87wC1Fhs5B3ty2Oew5P8I= X-Google-Smtp-Source: AJdET5d2oDBeZVbdIaGNWr6etEdes2Si5Ng5B4+vNlqXKoxTfz7lPS4Yg/TARqHNwepXSd8B+bLg5Q== X-Received: by 2002:a6b:8d55:: with SMTP id p82-v6mr5835020iod.74.1540713587477; Sun, 28 Oct 2018 00:59:47 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id v193-v6sm3810145ita.2.2018.10.28.00.59.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Oct 2018 00:59:46 -0700 (PDT) Subject: Re: bug#25554: date to support iso-8601 week-format (patch included) To: Rami Lehti , 25554@debbugs.gnu.org References: <1f44a48d-96a0-cea4-5023-64b02a8df2d8@bitwise.fi> <74e301c8-eaca-369b-d94d-b775bcc9ef5d@cs.ucla.edu> From: Assaf Gordon Message-ID: Date: Sun, 28 Oct 2018 01:59:45 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <74e301c8-eaca-369b-d94d-b775bcc9ef5d@cs.ucla.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 25554 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: -1.0 (-) retitle 25554 date: add iso-8601 week-format option severity 25554 wishlist tags 25554 wontfix patch close 25554 stop (triaging old bugs) On 2017-01-27 3:22 p.m., Paul Eggert wrote: > I dunno, there are several ISO 8601 formats that 'date -I' doesn't have > a special case for now; why add these particular shorthands? If we go > down this route, shouldn't we also add shorthands for %Y%j, %GW%V, > %G-W%V-%u, etc., etc.? Where will it stop? > > Instead, perhaps we should just suggest to people that they use ordinary > date formats, as standardized by POSIX. These should be more portable > anyway. -I is meant as a convenience for interactive use, and I doubt > whether people would want to use "date -Iweek" interactively much. > Given the above, and no further comments in more than a year, I'm closing this as "wontfix". Discussion can continue by replying to this thread. -assaf From unknown Fri Jun 20 07:19:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 25 Nov 2018 12:24:09 +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