Linux-man Archive on lore.kernel.org
 help / color / Atom feed
From: Eugene Syromyatnikov <evgsyr@gmail.com>
To: mtk.manpages@gmail.com
Cc: linux-man@vger.kernel.org
Subject: [PATCH] strftime.3: refer to the relevant nl_langinfo items
Date: Fri, 14 Feb 2020 16:29:01 +0100
Message-ID: <564214d230e0b42e93d938560ff61bb74c2c44b2.1581693625.git.evgsyr@gmail.com> (raw)
In-Reply-To: <cover.1581693624.git.evgsyr@gmail.com>

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


  parent reply index

Thread overview: 8+ 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-14 15:28 ` [PATCH] nl_langinfo.3: add information about AM/PM time format locale elements Eugene Syromyatnikov
2020-02-14 15:28 ` [PATCH] nl_langinfo.3: document era-related " Eugene Syromyatnikov
2020-02-14 15:28 ` [PATCH] strftime.3: ffix Eugene Syromyatnikov
2020-02-14 15:28 ` [PATCH] strftime.3: consistently document fall-back format string Eugene Syromyatnikov
2020-02-14 15:29 ` Eugene Syromyatnikov [this message]
2020-02-14 15:29 ` [PATCH] strftime.3: expand %E and %O description Eugene Syromyatnikov

Reply instructions:

You may reply publically 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=564214d230e0b42e93d938560ff61bb74c2c44b2.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

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git