Linux-man Archive on lore.kernel.org
 help / color / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Eugene Syromyatnikov <evgsyr@gmail.com>
Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org
Subject: Re: [PATCH] strftime.3: refer to the relevant nl_langinfo items
Date: Sun, 23 Feb 2020 22:32:20 +0100
Message-ID: <3714573f-8133-b066-260d-f32e9da73740@gmail.com> (raw)
In-Reply-To: <564214d230e0b42e93d938560ff61bb74c2c44b2.1581693625.git.evgsyr@gmail.com>

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/

  reply index

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 ` [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) [this message]
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=3714573f-8133-b066-260d-f32e9da73740@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=evgsyr@gmail.com \
    --cc=linux-man@vger.kernel.org \
    /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