linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eugene Syromyatnikov <evgsyr@gmail.com>
To: mtk.manpages@gmail.com
Cc: linux-man@vger.kernel.org
Subject: [PATCH] nl_langinfo.3: document era-related locale elements
Date: Fri, 14 Feb 2020 16:28:50 +0100	[thread overview]
Message-ID: <75355e111c4f5bb5f2f0034b0aa02eae71b9cc0b.1581693625.git.evgsyr@gmail.com> (raw)
In-Reply-To: <cover.1581693624.git.evgsyr@gmail.com>

Information is mostly taken from POSIX[1], GNU C Library documentation[2],
glibc strftime implementation[3], and Japanese locale definition[4].

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_05_02
[2] https://www.gnu.org/software/libc/manual/html_node/The-Elegant-and-Fast-Way.html
[3] https://sourceware.org/git/?p=glibc.git;a=blob;f=time/strftime_l.c
[4] https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/locales/ja_JP

* man3/nl_langinfo.3 (.SH DESCRIPTION): Add information about ERA,
ERA_D_T_FMT, ERA_D_FMT, and ERA_T_FMT locale elements.

Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
---
 man3/nl_langinfo.3 | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/man3/nl_langinfo.3 b/man3/nl_langinfo.3
index e16b094..3c4541a 100644
--- a/man3/nl_langinfo.3
+++ b/man3/nl_langinfo.3
@@ -119,6 +119,90 @@ to represent a time in a.m. or p.m. notation a locale-specific way
 .RB ( %r
 conversion specification).
 .TP
+.BR ERA \ (LC_TIME)
+Return era description, that contains information how years are counted
+and displayed for each era in a locale.
+Each era description segment shall have the format:
+.RS
+.IP
+.IR direction : offset : start_date : end_date : era_name : era_format
+.RE
+.IP
+according to the definitions below:
+.RS
+.TP 12
+.I direction
+Either a
+.RB \[dq] + "\[dq] or a \[dq]" - \[dq]
+character.
+The
+.RB \[dq] + \[dq]
+means that years increase from the
+.I start_date
+towards the
+.IR end_date ,
+.RB \[dq] - \[dq]
+means the opposite.
+.TP
+.I offset
+The epoch year of the
+.IR start_date .
+.TP
+.I start_date
+A date in the form
+.IR yyyy / mm / dd ,
+where
+.IR yyyy ", " mm ", and " dd
+are the year, month, and day numbers respectively of the start of the era.
+.TP
+.I end_date
+The ending date of the era, in the same format as the
+.IR start_date ,
+or one of the two special values
+.RB \[dq] -* \[dq]
+(minus infinity) or
+.RB \[dq] +* \[dq]
+(plus infinity).
+.TP
+.I era_name
+The name of the era, corresponding to the
+.B %EC
+.BR strftime (3)
+conversion specification.
+.TP
+.I era_format
+The format of the year in the era, corresponding to the
+.B %EY
+.BR strftime (3)
+conversion specification.
+.RE
+.IP
+Era description segments are separated by semicolons.
+Most locales do not define this value.
+Examples of locales that do define this value are the Japanese and the Thai
+locales.
+.TP
+.BR ERA_D_T_FMT \ (LC_TIME)
+Return a string that can be used as a format string for
+.BR strftime (3)
+for alternative representation of time and date in a locale-specific way
+.RB ( %Ec
+conversion specification).
+.TP
+.BR ERA_D_FMT \ (LC_TIME)
+Return a string that can be used as a format string for
+.BR strftime (3)
+for alternative representation of a date in a locale-specific way
+.RB ( %Ex
+conversion specification).
+.TP
+.BR ERA_T_FMT \ (LC_TIME)
+Return a string that can be used as a format string for
+.BR strftime (3)
+for alternative representation of a time in a locale-specific way
+.RB ( %EX
+conversion specification).
+.TP
 .BR DAY_ "{1\(en7} (LC_TIME)"
 Return name of the \fIn\fP-th day of the week. [Warning: this follows
 the US convention DAY_1 = Sunday, not the international convention
-- 
2.1.4


  parent reply	other threads:[~2020-02-14 15:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 15:28 [PATCH] Some stftime.3 and nl_langinfo.3 updates Eugene Syromyatnikov
2020-02-14 15:28 ` [PATCH] nl_langinfo.3: mention the respective strftime conversion specifications Eugene Syromyatnikov
2020-02-23 21:14   ` Michael Kerrisk (man-pages)
2020-02-14 15:28 ` [PATCH] nl_langinfo.3: add information about AM/PM time format locale elements Eugene Syromyatnikov
2020-02-23 21:15   ` Michael Kerrisk (man-pages)
2020-02-14 15:28 ` Eugene Syromyatnikov [this message]
2020-02-23 21:23   ` [PATCH] nl_langinfo.3: document era-related " Michael Kerrisk (man-pages)
2020-02-14 15:28 ` [PATCH] strftime.3: ffix Eugene Syromyatnikov
2020-02-23 21:26   ` Michael Kerrisk (man-pages)
2020-02-14 15:28 ` [PATCH] strftime.3: consistently document fall-back format string Eugene Syromyatnikov
2020-02-23 21:27   ` Michael Kerrisk (man-pages)
2020-02-14 15:29 ` [PATCH] strftime.3: refer to the relevant nl_langinfo items Eugene Syromyatnikov
2020-02-23 21:32   ` Michael Kerrisk (man-pages)
2020-02-14 15:29 ` [PATCH] strftime.3: expand %E and %O description Eugene Syromyatnikov
2020-02-23 21:43   ` Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=75355e111c4f5bb5f2f0034b0aa02eae71b9cc0b.1581693625.git.evgsyr@gmail.com \
    --to=evgsyr@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).