From patchwork Sun Jan 6 06:35:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: TAMUKI Shoichi X-Patchwork-Id: 1021043 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-99080-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linet.gr.jp Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="gtpBK6z3"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43XTlV00djz9sCr for ; Sun, 6 Jan 2019 17:54:13 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:from:date:to:subject:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=cjrlF 9KsLXyPXdwz7M3c863pW9VqFZ3fYfMFHdHzkuRUu5KGq+jPJduyF9b/n83N3Jha/ 9C0weRMKMXKFP6CnvfHdM0bC77KNdqxA8PKcN/JpcP2ESi0P0MTj8j0dyfC3pcoh vxos/ExXchOnhT5s9AUHKKnwMlK0NFLpZruaNc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:from:date:to:subject:in-reply-to :references:mime-version:content-type; s=default; bh=qWFvvGPOkoe jfWqGpZNbw6lYzOk=; b=gtpBK6z3yNNIJFJb/QP2PNnLIGdCQ2AOpN0N64/3d1n 6DRq+0/THluC3Z80Pa+t/dkbiUDE3Jz39px7QfaXkQ6UmeudKtMmaDbYDLNT4uOJ fslT1tFRFgrt7dHwYaS3anaM4f+8DSg3PXNQ4oCCDhRgDSDDkQfln0RThp5hyaP4 = Received: (qmail 41435 invoked by alias); 6 Jan 2019 06:54:07 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 41206 invoked by uid 89); 6 Jan 2019 06:54:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=greatest, century, Major, month X-HELO: mail.linet.jp Message-Id: <201901060635.AA04161@tamuki.linet.gr.jp> From: TAMUKI Shoichi Date: Sun, 06 Jan 2019 15:35:27 +0900 To: libc-alpha@sourceware.org Subject: [PATCH v5 5/5] strftime: Document the description for "%EC", "%Ey", and "%EY" [BZ #23758] In-Reply-To: <201901060628.AA04156@tamuki.linet.gr.jp> References: <201901060628.AA04156@tamuki.linet.gr.jp> MIME-Version: 1.0 Document the description for "%EC", "%Ey", and "%EY" for strftime. Also, fix the wording to "alternative" rather than "alternate". ChangeLog: [BZ #23758] * NEWS: Mention the change. * manual/time.texi (strftime): Document the desctiption for "%EC", "%Ey", and "%EY". Also, fix the wording to "alternative" rather than "alternate". --- NEWS | 7 +++++++ manual/time.texi | 21 ++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 4c8bc924ce3..835f5c2ba22 100644 --- a/NEWS +++ b/NEWS @@ -52,6 +52,13 @@ Major new features: - C-SKY ABIV2 soft-float little-endian - C-SKY ABIV2 hard-float little-endian +* Improve the width of alternative representation for year in + strftime. For %Ey conversion specifier, the default action is now + to pad the number with zero to keep minimum 2 digits, similar to %y. + Also, the optional flag (either _ or -) can be used for %EY, so that + the internal %Ey is interpreted as if decorated with the appropriate + flag. + Deprecated and removed features, and other changes affecting compatibility: * The glibc.tune tunable namespace has been renamed to glibc.cpu and the diff --git a/manual/time.texi b/manual/time.texi index 4d154452eba..6c3bfebb8a0 100644 --- a/manual/time.texi +++ b/manual/time.texi @@ -1339,7 +1339,7 @@ POSIX.2-1992 and by @w{ISO C99}, are: @table @code @item E -Use the locale's alternate representation for date and time. This +Use the locale's alternative representation for date and time. This modifier applies to the @code{%c}, @code{%C}, @code{%x}, @code{%X}, @code{%y} and @code{%Y} format specifiers. In a Japanese locale, for example, @code{%Ex} might yield a date format based on the Japanese @@ -1347,7 +1347,7 @@ Emperors' reigns. @item O With all format specifiers that produce numbers: use the locale's -alternate numeric symbols. +alternative numeric symbols. With @code{%B}, @code{%b}, and @code{%h}: use the grammatical form for month names that is appropriate when the month is named by itself, @@ -1355,7 +1355,7 @@ rather than the form that is appropriate when the month is used as part of a complete date. This is a GNU extension. @end table -If the format supports the modifier but no alternate representation +If the format supports the modifier but no alternative representation is available, it is ignored. The conversion specifier ends with a format specifier taken from the @@ -1393,6 +1393,9 @@ The preferred calendar time representation for the current locale. The century of the year. This is equivalent to the greatest integer not greater than the year divided by 100. +If the @code{E} modifier is specified (@code{%EC}), the locale's +alternative representation for year (the era name) is used instead. + This format was first standardized by POSIX.2-1992 and by @w{ISO C99}. @item %d @@ -1568,10 +1571,22 @@ The preferred time of day representation for the current locale. The year without a century as a decimal number (range @code{00} through @code{99}). This is equivalent to the year modulo 100. +If the @code{E} modifier is specified (@code{%Ey}), the locale's +alternative representation for year (the era year) is used instead. +The default action is to pad the number with zero to keep minimum 2 +digits, similar to @code{%y}. + @item %Y The year as a decimal number, using the Gregorian calendar. Years before the year @code{1} are numbered @code{0}, @code{-1}, and so on. +If the @code{E} modifier is specified (@code{%EY}), the locale's +alternative representation for year (generally the combination of +@code{%EC} and @code{%Ey}) is used instead. In this case, the +optional flag (either @code{_} or @code{-}) can be used, so that the +internal @code{%Ey} is interpreted as if decorated with the +appropriate flag. + @item %z @w{RFC 822}/@w{ISO 8601:1988} style numeric time zone (e.g., @code{-0600} or @code{+0100}), or nothing if no time zone is