linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Some stftime.3 and nl_langinfo.3 updates
@ 2020-02-14 15:28 Eugene Syromyatnikov
  2020-02-14 15:28 ` [PATCH] nl_langinfo.3: mention the respective strftime conversion specifications Eugene Syromyatnikov
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Eugene Syromyatnikov @ 2020-02-14 15:28 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man

Hello.

There are some additions that cross-link these two pages and aim to make
the behaviour of a libc more clear with respect to locale-dependent
conversion specifications.  It is based on POSIX[1], GNU C Library
documentation[2], and glibc's implementation[3], with some
cross-checking of uClibc, musl, and FreeBSD implementations.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html
[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

Eugene Syromyatnikov (7):
  nl_langinfo.3: mention the respective strftime conversion
    specifications
  nl_langinfo.3: add information about AM/PM time format locale elements
  nl_langinfo.3: document era-related locale elements
  strftime.3: ffix
  strftime.3: consistently document fall-back format string
  strftime.3: refer to the relevant nl_langinfo items
  strftime.3: expand %E and %O description

 man3/nl_langinfo.3 | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 man3/strftime.3    | 106 ++++++++++++++++++++++++++++++++++++++---
 2 files changed, 232 insertions(+), 9 deletions(-)

-- 
2.1.4


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] nl_langinfo.3: mention the respective strftime conversion specifications
  2020-02-14 15:28 [PATCH] Some stftime.3 and nl_langinfo.3 updates Eugene Syromyatnikov
@ 2020-02-14 15:28 ` 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
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Eugene Syromyatnikov @ 2020-02-14 15:28 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man

* man3/nl_langinfo.3 (D_T_FMT, D_FMT, T_FMT, DAY_{1–7}, ABDAY_{1–7},
MON_{1–12}, ABMON_{1–12}): Mention the respective strftime(3) conversion
specifications.

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

diff --git a/man3/nl_langinfo.3 b/man3/nl_langinfo.3
index 8c0742f..ecc1954 100644
--- a/man3/nl_langinfo.3
+++ b/man3/nl_langinfo.3
@@ -78,31 +78,53 @@ try "locale \-m" (see
 .BR D_T_FMT \ (LC_TIME)
 Return a string that can be used as a format string for
 .BR strftime (3)
-to represent time and date in a locale-specific way.
+to represent time and date in a locale-specific way
+.RB ( %c
+conversion specification).
 .TP
 .BR D_FMT \ (LC_TIME)
 Return a string that can be used as a format string for
 .BR strftime (3)
-to represent a date in a locale-specific way.
+to represent a date in a locale-specific way
+.RB ( %x
+conversion specification).
 .TP
 .BR T_FMT \ (LC_TIME)
 Return a string that can be used as a format string for
 .BR strftime (3)
-to represent a time in a locale-specific way.
+to represent a time in a locale-specific way
+.RB ( %X
+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
 (ISO 8601) that Monday is the first day of the week.]
+(Used in
+.B %A
+.BR strftime (3)
+conversion specification.)
 .TP
 .BR ABDAY_ "{1\(en7} (LC_TIME)"
 Return abbreviated name of the \fIn\fP-th day of the week.
+(Used in
+.B %a
+.BR strftime (3)
+conversion specification.)
 .TP
 .BR MON_ "{1\(en12} (LC_TIME)"
 Return name of the \fIn\fP-th month.
+(Used in
+.B %B
+.BR strftime (3)
+conversion specification.)
 .TP
 .BR ABMON_ "{1\(en12} (LC_TIME)"
 Return abbreviated name of the \fIn\fP-th month.
+(Used in
+.B %b
+.BR strftime (3)
+conversion specification.)
 .TP
 .BR RADIXCHAR \ (LC_NUMERIC)
 Return radix character (decimal dot, decimal comma, etc.).
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] nl_langinfo.3: add information about AM/PM time format locale elements
  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-14 15:28 ` Eugene Syromyatnikov
  2020-02-23 21:15   ` Michael Kerrisk (man-pages)
  2020-02-14 15:28 ` [PATCH] nl_langinfo.3: document era-related " Eugene Syromyatnikov
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Eugene Syromyatnikov @ 2020-02-14 15:28 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man

* man3/nl_langinfo.3 (.SH DESCRIPTION): Add description for AM_STR,
PM_STR, T_FMT_AMPM locale elements.

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

diff --git a/man3/nl_langinfo.3 b/man3/nl_langinfo.3
index ecc1954..e16b094 100644
--- a/man3/nl_langinfo.3
+++ b/man3/nl_langinfo.3
@@ -96,6 +96,29 @@ to represent a time in a locale-specific way
 .RB ( %X
 conversion specification).
 .TP
+.BR AM_STR \ (LC_TIME)
+Return a string that represents affix for ante meridiem (before noon, "AM")
+time.
+(Used in
+.B %p
+.BR strftime (3)
+conversion specification.)
+.TP
+.BR PM_STR \ (LC_TIME)
+Return a string that represents affix for post meridiem (before midnight, "PM")
+time.
+(Used in
+.B %p
+.BR strftime (3)
+conversion specification.)
+.TP
+.BR T_FMT_AMPM \ (LC_TIME)
+Return a string that can be used as a format string for
+.BR strftime (3)
+to represent a time in a.m. or p.m. notation a locale-specific way
+.RB ( %r
+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


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] nl_langinfo.3: document era-related locale elements
  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-14 15:28 ` [PATCH] nl_langinfo.3: add information about AM/PM time format locale elements Eugene Syromyatnikov
@ 2020-02-14 15:28 ` Eugene Syromyatnikov
  2020-02-23 21:23   ` Michael Kerrisk (man-pages)
  2020-02-14 15:28 ` [PATCH] strftime.3: ffix Eugene Syromyatnikov
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Eugene Syromyatnikov @ 2020-02-14 15:28 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man

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


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] strftime.3: ffix
  2020-02-14 15:28 [PATCH] Some stftime.3 and nl_langinfo.3 updates Eugene Syromyatnikov
                   ` (2 preceding siblings ...)
  2020-02-14 15:28 ` [PATCH] nl_langinfo.3: document era-related " Eugene Syromyatnikov
@ 2020-02-14 15:28 ` 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
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Eugene Syromyatnikov @ 2020-02-14 15:28 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man

* man3/strftime.3 (%s): Format "mktime" with .B and not .I.

Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
---
 man3/strftime.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/strftime.3 b/man3/strftime.3
index d6e6e34..62b77bf 100644
--- a/man3/strftime.3
+++ b/man3/strftime.3
@@ -255,7 +255,7 @@ below.
 .B %s
 The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). (TZ)
 (Calculated from
-.IR mktime(tm) .)
+.BR mktime ( \fItm\fR ).)
 .TP
 .B %S
 The second as a decimal number (range 00 to 60).
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] strftime.3: consistently document fall-back format string
  2020-02-14 15:28 [PATCH] Some stftime.3 and nl_langinfo.3 updates Eugene Syromyatnikov
                   ` (3 preceding siblings ...)
  2020-02-14 15:28 ` [PATCH] strftime.3: ffix Eugene Syromyatnikov
@ 2020-02-14 15:28 ` 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-14 15:29 ` [PATCH] strftime.3: expand %E and %O description Eugene Syromyatnikov
  6 siblings, 1 reply; 15+ messages in thread
From: Eugene Syromyatnikov @ 2020-02-14 15:28 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man

The information is taken from POSIX[1] and the implementations[2][3][4].

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_05_03
[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=time/strftime_l.c
[3] https://git.musl-libc.org/cgit/musl/tree/src/locale/langinfo.c#n15
[4] https://git.uclibc.org/uClibc/tree/libc/misc/locale/locale.c#n992

* man3/strftime.3 (%c, %x, %X): Add information about fall-back format.
(%r): Move it behind SU comment.

Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
---
 man3/strftime.3 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/man3/strftime.3 b/man3/strftime.3
index 62b77bf..dd7dec7 100644
--- a/man3/strftime.3
+++ b/man3/strftime.3
@@ -107,6 +107,8 @@ The full month name according to the current locale.
 .TP
 .B %c
 The preferred date and time representation for the current locale.
+(In the POSIX locale this is equivalent to
+.BR "%a %b %e %H:%M:%S %Y" .)
 .TP
 .B %C
 The century number (year/100) as a 2-digit integer. (SU)
@@ -240,9 +242,9 @@ string for the current locale.
 .TP
 .B %r
 The time in a.m. or p.m. notation.
-In the POSIX locale this is equivalent to
-.BR "%I:%M:%S %p" .
 (SU)
+(In the POSIX locale this is equivalent to
+.BR "%I:%M:%S %p" .)
 .TP
 .B %R
 The time in 24-hour notation
@@ -324,9 +326,13 @@ and
 .TP
 .B %x
 The preferred date representation for the current locale without the time.
+(In the POSIX locale this is equivalent to
+.BR %m/%d/%y .)
 .TP
 .B %X
 The preferred time representation for the current locale without the date.
+(In the POSIX locale this is equivalent to
+.BR %H:%M:%S .)
 .TP
 .B %y
 The year as a decimal number without a century (range 00 to 99).
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] strftime.3: refer to the relevant nl_langinfo items
  2020-02-14 15:28 [PATCH] Some stftime.3 and nl_langinfo.3 updates Eugene Syromyatnikov
                   ` (4 preceding siblings ...)
  2020-02-14 15:28 ` [PATCH] strftime.3: consistently document fall-back format string Eugene Syromyatnikov
@ 2020-02-14 15:29 ` 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
  6 siblings, 1 reply; 15+ messages in thread
From: Eugene Syromyatnikov @ 2020-02-14 15:29 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man

As it wasn't clear before where this kind of information can be
obtained from.

* man3/strftime.3 (%a, %A, %b, %B, %c, %p, %r, %x, %X): Add information
about the locale elements that can be used to retrieve the relevant
information using nl_langinfo() library call.

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

diff --git a/man3/strftime.3 b/man3/strftime.3
index dd7dec7..20ba057 100644
--- a/man3/strftime.3
+++ b/man3/strftime.3
@@ -89,24 +89,55 @@ structure are also shown.
 The abbreviated name of the day of the week according to the current locale.
 (Calculated from
 .IR tm_wday .)
+(The specific names used in the current locale can be obtained by calling
+.BR nl_langinfo (3)
+library call with
+.BR ABDAY_ { 1 \(en 7 }
+as an argument.)
 .TP
 .B %A
 The full name of the day of the week according to the current locale.
 (Calculated from
 .IR tm_wday .)
+(The specific names used in the current locale can be obtained by calling
+.BR nl_langinfo (3)
+library call with
+.BR DAY_ { 1 \(en 7 }
+as an argument.)
 .TP
 .B %b
 The abbreviated month name according to the current locale.
 (Calculated from
 .IR tm_mon .)
+(The specific names used in the current locale can be obtained by calling
+.BR nl_langinfo (3)
+library call with
+.BR ABMON_ { 1 \(en 12 }
+as an argument.)
 .TP
 .B %B
 The full month name according to the current locale.
 (Calculated from
 .IR tm_mon .)
+(The specific names used in the current locale can be obtained by calling
+.BR nl_langinfo (3)
+library call with
+.BR MON_ { 1 \(en 12 }
+as an argument.)
 .TP
 .B %c
 The preferred date and time representation for the current locale.
+(The specific format used in the current locale can be obtained by calling
+.BR nl_langinfo (3)
+library call with
+.B D_T_FMT
+as an argument for the
+.B %c
+conversion specification, and with
+.B ERA_D_T_FMT
+for the
+.B %Ec
+conversion specification.)
 (In the POSIX locale this is equivalent to
 .BR "%a %b %e %H:%M:%S %Y" .)
 .TP
@@ -230,6 +261,12 @@ corresponding strings for the current locale.
 Noon is treated as "PM" and midnight as "AM".
 (Calculated from
 .IR tm_hour .)
+(The specific string representations used for "AM" and "PM"
+in the current locale can be obtained by calling
+.BR nl_langinfo (3)
+library call with
+.BR AM_STR " and " PM_STR ,
+respectively.)
 .TP
 .B %P
 Like
@@ -243,6 +280,11 @@ string for the current locale.
 .B %r
 The time in a.m. or p.m. notation.
 (SU)
+(The specific format used in the current locale can be obtained by calling
+.BR nl_langinfo (3)
+library call with
+.B T_FMT_AMPM
+as an argument.)
 (In the POSIX locale this is equivalent to
 .BR "%I:%M:%S %p" .)
 .TP
@@ -326,11 +368,33 @@ and
 .TP
 .B %x
 The preferred date representation for the current locale without the time.
+(The specific format used in the current locale can be obtained by calling
+.BR nl_langinfo (3)
+library call with
+.B D_FMT
+as an argument for the
+.B %x
+conversion specification, and with
+.B ERA_D_FMT
+for the
+.B %Ex
+conversion specification.)
 (In the POSIX locale this is equivalent to
 .BR %m/%d/%y .)
 .TP
 .B %X
 The preferred time representation for the current locale without the date.
+(The specific format used in the current locale can be obtained by calling
+.BR nl_langinfo (3)
+library call with
+.B T_FMT
+as an argument for the
+.B %X
+conversion specification, and with
+.B ERA_T_FMT
+for the
+.B %EX
+conversion specification.)
 (In the POSIX locale this is equivalent to
 .BR %H:%M:%S .)
 .TP
@@ -657,6 +721,7 @@ main(int argc, char *argv[])
 .BR date (1),
 .BR time (2),
 .BR ctime (3),
+.BR nl_langinfo (3),
 .BR setlocale (3),
 .BR sprintf (3),
 .BR strptime (3)
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] strftime.3: expand %E and %O description
  2020-02-14 15:28 [PATCH] Some stftime.3 and nl_langinfo.3 updates Eugene Syromyatnikov
                   ` (5 preceding siblings ...)
  2020-02-14 15:29 ` [PATCH] strftime.3: refer to the relevant nl_langinfo items Eugene Syromyatnikov
@ 2020-02-14 15:29 ` Eugene Syromyatnikov
  2020-02-23 21:43   ` Michael Kerrisk (man-pages)
  6 siblings, 1 reply; 15+ messages in thread
From: Eugene Syromyatnikov @ 2020-02-14 15:29 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man

* man3/strftime.3 (%C): Descibe the meaning of %EC conversion
specification.
(%E): Mention the concept of "era" in description.
(%O): Mention that alternative format is related to numeric
representation.
(%y): Describe the meaning of %Ey conversion specification.
(%Y): Describe the meaning of %EY conversion specification.
(.SH DESCRIPTION): Mention that the behaviour of %E modifier is governed
by ERA locale element and provide ja_JP locale as an example.

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

diff --git a/man3/strftime.3 b/man3/strftime.3
index 20ba057..bdbea68 100644
--- a/man3/strftime.3
+++ b/man3/strftime.3
@@ -143,6 +143,9 @@ conversion specification.)
 .TP
 .B %C
 The century number (year/100) as a 2-digit integer. (SU)
+(The
+.B %EC
+conversion specification corresponds to the name of the era.)
 (Calculated from
 .IR tm_year .)
 .TP
@@ -170,7 +173,7 @@ zero is replaced by a space. (SU)
 .IR tm_mday .)
 .TP
 .B %E
-Modifier: use alternative format, see below. (SU)
+Modifier: use alternative ("era-based") format, see below. (SU)
 .TP
 .B %F
 Equivalent to
@@ -253,7 +256,7 @@ The minute as a decimal number (range 00 to 59).
 A newline character. (SU)
 .TP
 .B %O
-Modifier: use alternative format, see below. (SU)
+Modifier: use alternative numeric symbols, see below. (SU)
 .TP
 .B %p
 Either "AM" or "PM" according to the given time value, or the
@@ -400,11 +403,20 @@ conversion specification.)
 .TP
 .B %y
 The year as a decimal number without a century (range 00 to 99).
+(The
+.B %Ey
+conversion specification corresponds to the year since the beginning of the era
+denoted by
+.B %EC
+conversion specification.)
 (Calculated from
 .IR tm_year )
 .TP
 .B %Y
 The year as a decimal number including the century.
+(The
+.B %EY
+conversion specification corresponds to the full alternative year representation.)
 (Calculated from
 .IR tm_year )
 .TP
@@ -463,7 +475,18 @@ where the effect of the
 .B O
 modifier is to use
 alternative numeric symbols (say, roman numerals), and that of the
-E modifier is to use a locale-dependent alternative representation.
+.B E
+modifier is to use a locale-dependent alternative representation.
+The rules governing date representation with the
+.B E
+modifier can be obtained by supplying
+.B ERA
+as an argument to a
+.BR nl_langinfo (3)
+library call.
+One example of such alternative forms is Japanese era calendar scheme in the
+.B ja_JP
+glibc locale.
 .SH RETURN VALUE
 Provided that the result string,
 including the terminating null byte, does not exceed
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] nl_langinfo.3: mention the respective strftime conversion specifications
  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)
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-02-23 21:14 UTC (permalink / raw)
  To: Eugene Syromyatnikov; +Cc: mtk.manpages, linux-man

Hello Eugene,

On 2/14/20 4:28 PM, Eugene Syromyatnikov wrote:
> * man3/nl_langinfo.3 (D_T_FMT, D_FMT, T_FMT, DAY_{1–7}, ABDAY_{1–7},
> MON_{1–12}, ABMON_{1–12}): Mention the respective strftime(3) conversion
> specifications.

Thanks,

Patch applied.

Cheers,

Michael

> Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
> ---
>  man3/nl_langinfo.3 | 28 +++++++++++++++++++++++++---
>  1 file changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/man3/nl_langinfo.3 b/man3/nl_langinfo.3
> index 8c0742f..ecc1954 100644
> --- a/man3/nl_langinfo.3
> +++ b/man3/nl_langinfo.3
> @@ -78,31 +78,53 @@ try "locale \-m" (see
>  .BR D_T_FMT \ (LC_TIME)
>  Return a string that can be used as a format string for
>  .BR strftime (3)
> -to represent time and date in a locale-specific way.
> +to represent time and date in a locale-specific way
> +.RB ( %c
> +conversion specification).
>  .TP
>  .BR D_FMT \ (LC_TIME)
>  Return a string that can be used as a format string for
>  .BR strftime (3)
> -to represent a date in a locale-specific way.
> +to represent a date in a locale-specific way
> +.RB ( %x
> +conversion specification).
>  .TP
>  .BR T_FMT \ (LC_TIME)
>  Return a string that can be used as a format string for
>  .BR strftime (3)
> -to represent a time in a locale-specific way.
> +to represent a time in a locale-specific way
> +.RB ( %X
> +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
>  (ISO 8601) that Monday is the first day of the week.]
> +(Used in
> +.B %A
> +.BR strftime (3)
> +conversion specification.)
>  .TP
>  .BR ABDAY_ "{1\(en7} (LC_TIME)"
>  Return abbreviated name of the \fIn\fP-th day of the week.
> +(Used in
> +.B %a
> +.BR strftime (3)
> +conversion specification.)
>  .TP
>  .BR MON_ "{1\(en12} (LC_TIME)"
>  Return name of the \fIn\fP-th month.
> +(Used in
> +.B %B
> +.BR strftime (3)
> +conversion specification.)
>  .TP
>  .BR ABMON_ "{1\(en12} (LC_TIME)"
>  Return abbreviated name of the \fIn\fP-th month.
> +(Used in
> +.B %b
> +.BR strftime (3)
> +conversion specification.)
>  .TP
>  .BR RADIXCHAR \ (LC_NUMERIC)
>  Return radix character (decimal dot, decimal comma, etc.).
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] nl_langinfo.3: add information about AM/PM time format locale elements
  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)
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-02-23 21:15 UTC (permalink / raw)
  To: Eugene Syromyatnikov; +Cc: mtk.manpages, linux-man

Hello Eugene,

On 2/14/20 4:28 PM, Eugene Syromyatnikov wrote:
> * man3/nl_langinfo.3 (.SH DESCRIPTION): Add description for AM_STR,
> PM_STR, T_FMT_AMPM locale elements.

Thanks. Patch applied.

Cheers,

Michael


> Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
> ---
>  man3/nl_langinfo.3 | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/man3/nl_langinfo.3 b/man3/nl_langinfo.3
> index ecc1954..e16b094 100644
> --- a/man3/nl_langinfo.3
> +++ b/man3/nl_langinfo.3
> @@ -96,6 +96,29 @@ to represent a time in a locale-specific way
>  .RB ( %X
>  conversion specification).
>  .TP
> +.BR AM_STR \ (LC_TIME)
> +Return a string that represents affix for ante meridiem (before noon, "AM")
> +time.
> +(Used in
> +.B %p
> +.BR strftime (3)
> +conversion specification.)
> +.TP
> +.BR PM_STR \ (LC_TIME)
> +Return a string that represents affix for post meridiem (before midnight, "PM")
> +time.
> +(Used in
> +.B %p
> +.BR strftime (3)
> +conversion specification.)
> +.TP
> +.BR T_FMT_AMPM \ (LC_TIME)
> +Return a string that can be used as a format string for
> +.BR strftime (3)
> +to represent a time in a.m. or p.m. notation a locale-specific way
> +.RB ( %r
> +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
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] nl_langinfo.3: document era-related locale elements
  2020-02-14 15:28 ` [PATCH] nl_langinfo.3: document era-related " Eugene Syromyatnikov
@ 2020-02-23 21:23   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-02-23 21:23 UTC (permalink / raw)
  To: Eugene Syromyatnikov; +Cc: mtk.manpages, linux-man

Hello Eugene,

On 2/14/20 4:28 PM, Eugene Syromyatnikov wrote:
> Information is mostly taken from POSIX[1], GNU C Library documentation[2],
> glibc strftime implementation[3], and Japanese locale definition[4].

Thanks. Patch applied.

Cheers,

Michael

 
> [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
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] strftime.3: ffix
  2020-02-14 15:28 ` [PATCH] strftime.3: ffix Eugene Syromyatnikov
@ 2020-02-23 21:26   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-02-23 21:26 UTC (permalink / raw)
  To: Eugene Syromyatnikov; +Cc: mtk.manpages, linux-man

Hi Eugene,

On 2/14/20 4:28 PM, Eugene Syromyatnikov wrote:
> * man3/strftime.3 (%s): Format "mktime" with .B and not .I.
> 
> Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
> ---
>  man3/strftime.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/strftime.3 b/man3/strftime.3
> index d6e6e34..62b77bf 100644
> --- a/man3/strftime.3
> +++ b/man3/strftime.3
> @@ -255,7 +255,7 @@ below.
>  .B %s
>  The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). (TZ)
>  (Calculated from
> -.IR mktime(tm) .)
> +.BR mktime ( \fItm\fR ).)

The usual convention here is .IR. .BR is used for page
cross-references (e.g., ".BR mktime (3)"). (But, that said,
it would not surprise me if there were some inconsistencies
in existing pages.)

Thanks,

Michael

>  .TP
>  .B %S
>  The second as a decimal number (range 00 to 60).
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] strftime.3: consistently document fall-back format string
  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)
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-02-23 21:27 UTC (permalink / raw)
  To: Eugene Syromyatnikov; +Cc: mtk.manpages, linux-man

Hello Eugene,

On 2/14/20 4:28 PM, Eugene Syromyatnikov wrote:
> The information is taken from POSIX[1] and the implementations[2][3][4].

Thanks. Patch applied.

Cheers,

Michael

> [1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_05_03
> [2] https://sourceware.org/git/?p=glibc.git;a=blob;f=time/strftime_l.c
> [3] https://git.musl-libc.org/cgit/musl/tree/src/locale/langinfo.c#n15
> [4] https://git.uclibc.org/uClibc/tree/libc/misc/locale/locale.c#n992
> 
> * man3/strftime.3 (%c, %x, %X): Add information about fall-back format.
> (%r): Move it behind SU comment.
> 
> Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
> ---
>  man3/strftime.3 | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/man3/strftime.3 b/man3/strftime.3
> index 62b77bf..dd7dec7 100644
> --- a/man3/strftime.3
> +++ b/man3/strftime.3
> @@ -107,6 +107,8 @@ The full month name according to the current locale.
>  .TP
>  .B %c
>  The preferred date and time representation for the current locale.
> +(In the POSIX locale this is equivalent to
> +.BR "%a %b %e %H:%M:%S %Y" .)
>  .TP
>  .B %C
>  The century number (year/100) as a 2-digit integer. (SU)
> @@ -240,9 +242,9 @@ string for the current locale.
>  .TP
>  .B %r
>  The time in a.m. or p.m. notation.
> -In the POSIX locale this is equivalent to
> -.BR "%I:%M:%S %p" .
>  (SU)
> +(In the POSIX locale this is equivalent to
> +.BR "%I:%M:%S %p" .)
>  .TP
>  .B %R
>  The time in 24-hour notation
> @@ -324,9 +326,13 @@ and
>  .TP
>  .B %x
>  The preferred date representation for the current locale without the time.
> +(In the POSIX locale this is equivalent to
> +.BR %m/%d/%y .)
>  .TP
>  .B %X
>  The preferred time representation for the current locale without the date.
> +(In the POSIX locale this is equivalent to
> +.BR %H:%M:%S .)
>  .TP
>  .B %y
>  The year as a decimal number without a century (range 00 to 99).
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] strftime.3: refer to the relevant nl_langinfo items
  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)
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-02-23 21:32 UTC (permalink / raw)
  To: Eugene Syromyatnikov; +Cc: mtk.manpages, linux-man

Hello Eugene,

On 2/14/20 4:29 PM, Eugene Syromyatnikov wrote:
> As it wasn't clear before where this kind of information can be
> obtained from.
> 
> * man3/strftime.3 (%a, %A, %b, %B, %c, %p, %r, %x, %X): Add information
> about the locale elements that can be used to retrieve the relevant
> information using nl_langinfo() library call.

Thanks. Patch applied.

Cheers,

Michael

> Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
> ---
>  man3/strftime.3 | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 65 insertions(+)
> 
> diff --git a/man3/strftime.3 b/man3/strftime.3
> index dd7dec7..20ba057 100644
> --- a/man3/strftime.3
> +++ b/man3/strftime.3
> @@ -89,24 +89,55 @@ structure are also shown.
>  The abbreviated name of the day of the week according to the current locale.
>  (Calculated from
>  .IR tm_wday .)
> +(The specific names used in the current locale can be obtained by calling
> +.BR nl_langinfo (3)
> +library call with
> +.BR ABDAY_ { 1 \(en 7 }
> +as an argument.)
>  .TP
>  .B %A
>  The full name of the day of the week according to the current locale.
>  (Calculated from
>  .IR tm_wday .)
> +(The specific names used in the current locale can be obtained by calling
> +.BR nl_langinfo (3)
> +library call with
> +.BR DAY_ { 1 \(en 7 }
> +as an argument.)
>  .TP
>  .B %b
>  The abbreviated month name according to the current locale.
>  (Calculated from
>  .IR tm_mon .)
> +(The specific names used in the current locale can be obtained by calling
> +.BR nl_langinfo (3)
> +library call with
> +.BR ABMON_ { 1 \(en 12 }
> +as an argument.)
>  .TP
>  .B %B
>  The full month name according to the current locale.
>  (Calculated from
>  .IR tm_mon .)
> +(The specific names used in the current locale can be obtained by calling
> +.BR nl_langinfo (3)
> +library call with
> +.BR MON_ { 1 \(en 12 }
> +as an argument.)
>  .TP
>  .B %c
>  The preferred date and time representation for the current locale.
> +(The specific format used in the current locale can be obtained by calling
> +.BR nl_langinfo (3)
> +library call with
> +.B D_T_FMT
> +as an argument for the
> +.B %c
> +conversion specification, and with
> +.B ERA_D_T_FMT
> +for the
> +.B %Ec
> +conversion specification.)
>  (In the POSIX locale this is equivalent to
>  .BR "%a %b %e %H:%M:%S %Y" .)
>  .TP
> @@ -230,6 +261,12 @@ corresponding strings for the current locale.
>  Noon is treated as "PM" and midnight as "AM".
>  (Calculated from
>  .IR tm_hour .)
> +(The specific string representations used for "AM" and "PM"
> +in the current locale can be obtained by calling
> +.BR nl_langinfo (3)
> +library call with
> +.BR AM_STR " and " PM_STR ,
> +respectively.)
>  .TP
>  .B %P
>  Like
> @@ -243,6 +280,11 @@ string for the current locale.
>  .B %r
>  The time in a.m. or p.m. notation.
>  (SU)
> +(The specific format used in the current locale can be obtained by calling
> +.BR nl_langinfo (3)
> +library call with
> +.B T_FMT_AMPM
> +as an argument.)
>  (In the POSIX locale this is equivalent to
>  .BR "%I:%M:%S %p" .)
>  .TP
> @@ -326,11 +368,33 @@ and
>  .TP
>  .B %x
>  The preferred date representation for the current locale without the time.
> +(The specific format used in the current locale can be obtained by calling
> +.BR nl_langinfo (3)
> +library call with
> +.B D_FMT
> +as an argument for the
> +.B %x
> +conversion specification, and with
> +.B ERA_D_FMT
> +for the
> +.B %Ex
> +conversion specification.)
>  (In the POSIX locale this is equivalent to
>  .BR %m/%d/%y .)
>  .TP
>  .B %X
>  The preferred time representation for the current locale without the date.
> +(The specific format used in the current locale can be obtained by calling
> +.BR nl_langinfo (3)
> +library call with
> +.B T_FMT
> +as an argument for the
> +.B %X
> +conversion specification, and with
> +.B ERA_T_FMT
> +for the
> +.B %EX
> +conversion specification.)
>  (In the POSIX locale this is equivalent to
>  .BR %H:%M:%S .)
>  .TP
> @@ -657,6 +721,7 @@ main(int argc, char *argv[])
>  .BR date (1),
>  .BR time (2),
>  .BR ctime (3),
> +.BR nl_langinfo (3),
>  .BR setlocale (3),
>  .BR sprintf (3),
>  .BR strptime (3)
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] strftime.3: expand %E and %O description
  2020-02-14 15:29 ` [PATCH] strftime.3: expand %E and %O description Eugene Syromyatnikov
@ 2020-02-23 21:43   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-02-23 21:43 UTC (permalink / raw)
  To: Eugene Syromyatnikov; +Cc: mtk.manpages, linux-man

Hello Eugene,

On 2/14/20 4:29 PM, Eugene Syromyatnikov wrote:
> * man3/strftime.3 (%C): Descibe the meaning of %EC conversion
> specification.
> (%E): Mention the concept of "era" in description.
> (%O): Mention that alternative format is related to numeric
> representation.
> (%y): Describe the meaning of %Ey conversion specification.
> (%Y): Describe the meaning of %EY conversion specification.
> (.SH DESCRIPTION): Mention that the behaviour of %E modifier is governed
> by ERA locale element and provide ja_JP locale as an example.
> 
> Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>

Thanks! Patch applied.

Cheers,

Michael

> ---
>  man3/strftime.3 | 29 ++++++++++++++++++++++++++---
>  1 file changed, 26 insertions(+), 3 deletions(-)
> 
> diff --git a/man3/strftime.3 b/man3/strftime.3
> index 20ba057..bdbea68 100644
> --- a/man3/strftime.3
> +++ b/man3/strftime.3
> @@ -143,6 +143,9 @@ conversion specification.)
>  .TP
>  .B %C
>  The century number (year/100) as a 2-digit integer. (SU)
> +(The
> +.B %EC
> +conversion specification corresponds to the name of the era.)
>  (Calculated from
>  .IR tm_year .)
>  .TP
> @@ -170,7 +173,7 @@ zero is replaced by a space. (SU)
>  .IR tm_mday .)
>  .TP
>  .B %E
> -Modifier: use alternative format, see below. (SU)
> +Modifier: use alternative ("era-based") format, see below. (SU)
>  .TP
>  .B %F
>  Equivalent to
> @@ -253,7 +256,7 @@ The minute as a decimal number (range 00 to 59).
>  A newline character. (SU)
>  .TP
>  .B %O
> -Modifier: use alternative format, see below. (SU)
> +Modifier: use alternative numeric symbols, see below. (SU)
>  .TP
>  .B %p
>  Either "AM" or "PM" according to the given time value, or the
> @@ -400,11 +403,20 @@ conversion specification.)
>  .TP
>  .B %y
>  The year as a decimal number without a century (range 00 to 99).
> +(The
> +.B %Ey
> +conversion specification corresponds to the year since the beginning of the era
> +denoted by
> +.B %EC
> +conversion specification.)
>  (Calculated from
>  .IR tm_year )
>  .TP
>  .B %Y
>  The year as a decimal number including the century.
> +(The
> +.B %EY
> +conversion specification corresponds to the full alternative year representation.)
>  (Calculated from
>  .IR tm_year )
>  .TP
> @@ -463,7 +475,18 @@ where the effect of the
>  .B O
>  modifier is to use
>  alternative numeric symbols (say, roman numerals), and that of the
> -E modifier is to use a locale-dependent alternative representation.
> +.B E
> +modifier is to use a locale-dependent alternative representation.
> +The rules governing date representation with the
> +.B E
> +modifier can be obtained by supplying
> +.B ERA
> +as an argument to a
> +.BR nl_langinfo (3)
> +library call.
> +One example of such alternative forms is Japanese era calendar scheme in the
> +.B ja_JP
> +glibc locale.
>  .SH RETURN VALUE
>  Provided that the result string,
>  including the terminating null byte, does not exceed
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-02-23 21:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH] nl_langinfo.3: document era-related " Eugene Syromyatnikov
2020-02-23 21:23   ` 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)

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).