From: Michael Witten <mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 5/9] strftime.3: Move 822-compliant date format example to EXAMPLES section
Date: Thu, 3 Dec 2009 23:38:26 -0600 [thread overview]
Message-ID: <1259905106-4887-1-git-send-email-mfwitten@gmail.com> (raw)
In-Reply-To: <1259879998-1140-5-git-send-email-mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
The RFC 822-compliant date format given in the description of `%z'
is now moved to the EXAMPLE section (and EXAMPLE has been renamed
EXAMPLES).
Furthermore, that format example is now actually RFC 822-compliant
(using `%y' instead of `%Y') and has been qualified as being correct
only when in the context of at least an English locale. Also, `%T'
is used in place of `%H:%M:%S'.
For completeness, an RFC 2822-compliant format example has been
similarly added.
The formatting of the EXAMPLES section has been improved.
Signed-off-by: Michael Witten <mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
WOOPS!
Somehow I managed to produce a commit without actually
having changed `EXAMPLE' to `EXAMPLES'. This version
fixes that.
man3/strftime.3 | 30 +++++++++++++++++++++++-------
1 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/man3/strftime.3 b/man3/strftime.3
index 0d925fa..bafe841 100644
--- a/man3/strftime.3
+++ b/man3/strftime.3
@@ -242,9 +242,7 @@ The year as a decimal number without a century (range 00 to 99).
The year as a decimal number including the century.
.TP
.B %z
-The +hhmm or -hhmm numeric time zone (that is, the hour and minute offset from UTC).
-Required to emit RFC\ 822-conformant dates
-(using "%a,\ %d\ %b\ %Y\ %H:%M:%S\ %z"). (SU)
+The +hhmm or -hhmm numeric time zone (that is, the hour and minute offset from UTC). (SU)
.TP
.B %Z
The timezone or name or abbreviation.
@@ -441,14 +439,30 @@ Nowadays,
.BR gcc (1)
provides the \fI\-Wno\-format\-y2k\fP option to prevent the warning,
so that the above workaround is no longer required.
-.SH EXAMPLE
+.SH EXAMPLES
+.BR "RFC\ 2822-compliant date format"
+(with an English locale for %a and %b)
+.PP
+.in +2n
+"%a,\ %d\ %b\ %Y\ %T\ %z"
+.PP
+.BR "RFC\ 822-compliant date format"
+(with an English locale for %a and %b)
+.PP
+.in +2n
+"%a,\ %d\ %b\ %y\ %T\ %z"
+.PP
+.BR "Sample program"
+.PP
+.in +2n
The program below can be used to experiment with
.BR strftime ().
.PP
+.in +2n
Some examples of the result string produced by the glibc implementation of
.BR strftime ()
are as follows:
-.in +4n
+.in +2n
.nf
.RB "$" " ./a.out \(aq%m\(aq"
@@ -457,9 +471,11 @@ Result string is "11"
Result string is "00011"
.RB "$" " ./a.out \(aq%_5m\(aq"
Result string is " 11"
+
.fi
-.in
-.SS Program source
+.in -2n
+Here is the program source:
+.in +2n
\&
.nf
#include <time.h>
--
1.6.5.2.180.gc5b3e
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-12-04 5:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-03 22:39 [PATCH 1/9] tzset.3: Cleanup grammar/clarity Michael Witten
[not found] ` <1259879998-1140-1-git-send-email-mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-03 22:39 ` [PATCH 2/9] stime.2, strftime.3, tzset.3, zic.8: GMT -> UTC (where appropriate) Michael Witten
[not found] ` <1259879998-1140-2-git-send-email-mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-03 22:39 ` [PATCH 3/9] strftime.3: Clarification of %z Michael Witten
[not found] ` <1259879998-1140-3-git-send-email-mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-03 22:39 ` [PATCH 4/9] strftime.3: %z is defined by the SUSv3 Michael Witten
[not found] ` <1259879998-1140-4-git-send-email-mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-03 22:39 ` [PATCH 5/9] strftime.3: Move 822-compliant date format example to EXAMPLES section Michael Witten
[not found] ` <1259879998-1140-5-git-send-email-mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-03 22:39 ` [PATCH 6/9] strftime.3: Expanded introduction Michael Witten
[not found] ` <1259879998-1140-6-git-send-email-mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-03 22:39 ` [PATCH 7/9] "timezone" -> "time zone" Michael Witten
[not found] ` <1259879998-1140-7-git-send-email-mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-03 22:39 ` [PATCH 8/9] Consistently define the Epoch Michael Witten
[not found] ` <1259879998-1140-8-git-send-email-mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-03 22:39 ` [PATCH 9/9] "null terminated" -> "null-terminated" Michael Witten
2009-12-04 5:38 ` Michael Witten [this message]
2010-01-16 19:29 ` [PATCH 4/9] strftime.3: %z is defined by the SUSv3 Michael Kerrisk
-- strict thread matches above, loose matches on Subject: below --
2010-01-09 23:45 [OVERVIEW 0/9] Cleanup Time Michael Witten
[not found] ` <1263080737-2868-1-git-send-email-mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-01-09 23:45 ` [PATCH 5/9] strftime.3: Move 822-compliant date format example to EXAMPLES section Michael Witten
[not found] ` <1263080737-2868-6-git-send-email-mfwitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-01-17 5:33 ` Michael Kerrisk
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=1259905106-4887-1-git-send-email-mfwitten@gmail.com \
--to=mfwitten-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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
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).