Added GLIBC NOTES section describing padding and width specifiers.

This commit is contained in:
Michael Kerrisk 2005-11-22 18:41:24 +00:00
parent 8db74412a0
commit ee14b2e09f
1 changed files with 28 additions and 1 deletions

View File

@ -228,7 +228,6 @@ E modifier is to use a locale-dependent alternative representation.
The broken-down time structure \fItm\fP is defined in \fI<time.h>\fP.
See also
.BR ctime (3).
.SH "RETURN VALUE"
The \fBstrftime\fP() function returns the number of characters placed
in the array \fIs\fP, not including the terminating NUL character,
@ -259,6 +258,34 @@ In SUSv2, the %S specified allowed a range of 00 to 61,
to allow for the theoretical possibility of a minute that
included a double leap second
(there never has been such a minute).
.SH GLIBC NOTES
Glibc provides a number of extensions for conversion specifiers.
Between the % character and the conversion character,
an optional flag and field width may be specified.
(These precede the E or O modifies, if present.)
The following flag characters are permitted:
.TP
.B _
(underscore)
Pad a numeric output string with spaces.
.TP
.B \-
(dash)
Do not pad a numeric output string.
.TP
.B 0
Pad a numeric output string with zeros even if the conversion character
specifies space padding.
.TP
.B ^
Convert alphabetic characters in output string to upper case.
.TP
.B #
Swap the case of the output string (only really useful with %Z).
.PP
An optional decimal width specifier may follow the (possibly absent) flag.
If the natural size of the field is smaller than this width,
then the output string padded (on the left) to the specified width.
.SH BUGS
Some buggy versions of gcc complain about the use of %c:
.IR "warning: `%c' yields only last 2 digits of year in some locales" .