diff options
Diffstat (limited to 'src/lib/libc/string/strftime.3')
-rw-r--r-- | src/lib/libc/string/strftime.3 | 201 |
1 files changed, 0 insertions, 201 deletions
diff --git a/src/lib/libc/string/strftime.3 b/src/lib/libc/string/strftime.3 deleted file mode 100644 index db666bb315..0000000000 --- a/src/lib/libc/string/strftime.3 +++ /dev/null | |||
@@ -1,201 +0,0 @@ | |||
1 | .\" Copyright (c) 1989, 1991 The Regents of the University of California. | ||
2 | .\" All rights reserved. | ||
3 | .\" | ||
4 | .\" This code is derived from software contributed to Berkeley by | ||
5 | .\" the American National Standards Committee X3, on Information | ||
6 | .\" Processing Systems. | ||
7 | .\" | ||
8 | .\" Redistribution and use in source and binary forms, with or without | ||
9 | .\" modification, are permitted provided that the following conditions | ||
10 | .\" are met: | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
14 | .\" notice, this list of conditions and the following disclaimer in the | ||
15 | .\" documentation and/or other materials provided with the distribution. | ||
16 | .\" 3. All advertising materials mentioning features or use of this software | ||
17 | .\" must display the following acknowledgement: | ||
18 | .\" This product includes software developed by the University of | ||
19 | .\" California, Berkeley and its contributors. | ||
20 | .\" 4. Neither the name of the University nor the names of its contributors | ||
21 | .\" may be used to endorse or promote products derived from this software | ||
22 | .\" without specific prior written permission. | ||
23 | .\" | ||
24 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
25 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
26 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
27 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
28 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
29 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
30 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
31 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
32 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
34 | .\" SUCH DAMAGE. | ||
35 | .\" | ||
36 | .\" $OpenBSD: strftime.3,v 1.3 1996/08/19 08:34:17 tholo Exp $ | ||
37 | .\" | ||
38 | .Dd June 29, 1991 | ||
39 | .Dt STRFTIME 3 | ||
40 | .Os | ||
41 | .Sh NAME | ||
42 | .Nm strftime | ||
43 | .Nd format date and time | ||
44 | .Sh SYNOPSIS | ||
45 | .Fd #include <time.h> | ||
46 | .Ft size_t | ||
47 | .Fn strftime "char *buf" "size_t maxsize" "const char *format" "const struct tm *timeptr" | ||
48 | .Sh DESCRIPTION | ||
49 | The | ||
50 | .Fn strftime | ||
51 | function formats the information from | ||
52 | .Fa timeptr | ||
53 | into the buffer | ||
54 | .Fa buf | ||
55 | according to the string pointed to by | ||
56 | .Fa format . | ||
57 | .Pp | ||
58 | The | ||
59 | .Fa format | ||
60 | string consists of zero or more conversion specifications and | ||
61 | ordinary characters. | ||
62 | All ordinary characters are copied directly into the buffer. | ||
63 | A conversion specification consists of a percent sign | ||
64 | .Ql % | ||
65 | and one other character. | ||
66 | .Pp | ||
67 | No more than | ||
68 | .Fa maxsize | ||
69 | characters will be placed into the array. | ||
70 | If the total number of resulting characters, including the terminating | ||
71 | null character, is not more than | ||
72 | .Fa maxsize , | ||
73 | .Fn strftime | ||
74 | returns the number of characters in the array, not counting the | ||
75 | terminating null. | ||
76 | Otherwise, zero is returned. | ||
77 | .Pp | ||
78 | Each conversion specification is replaced by the characters as | ||
79 | follows which are then copied into the buffer. | ||
80 | .Bl -tag -width "xxxx" | ||
81 | .It Cm \&%A | ||
82 | is replaced by the locale's full weekday name. | ||
83 | .It Cm %a | ||
84 | is replaced by the locale's abbreviated weekday name. | ||
85 | .It Cm \&%B | ||
86 | is replaced by the locale's full month name. | ||
87 | .It Cm \&%b No or Cm \&%h | ||
88 | is replaced by the locale's abbreviated month name. | ||
89 | .It Cm \&%C | ||
90 | is replaced by the century (a year divided by 100 and truncated to an integer) | ||
91 | as a decimal number (00-99). | ||
92 | .It Cm \&%c | ||
93 | is replaced by the locale's appropriate date and time representation. | ||
94 | .It Cm \&%D | ||
95 | is replaced by the date in the format | ||
96 | .Dq Li %m/%d/%y . | ||
97 | .It Cm \&%d | ||
98 | is replaced by the day of the month as a decimal number (01-31). | ||
99 | .It Cm \&%e | ||
100 | is replaced by the day of month as a decimal number (1-31); | ||
101 | single digits are preceded by a blank. | ||
102 | .It Cm \&%H | ||
103 | is replaced by the hour (24-hour clock) as a decimal number (00-23). | ||
104 | .It Cm \&%I | ||
105 | is replaced by the hour (12-hour clock) as a decimal number (01-12). | ||
106 | .It Cm \&%j | ||
107 | is replaced by the day of the year as a decimal number (001-366). | ||
108 | .It Cm \&%k | ||
109 | is replaced by the hour (24-hour clock) as a decimal number (0-23); | ||
110 | single digits are preceded by a blank. | ||
111 | .It Cm \&%l | ||
112 | is replaced by the hour (12-hour clock) as a decimal number (1-12); | ||
113 | single digits are preceded by a blank. | ||
114 | .It Cm \&%M | ||
115 | is replaced by the minute as a decimal number (00-59). | ||
116 | .It Cm %m | ||
117 | is replaced by the month as a decimal number (01-12). | ||
118 | .It Cm %n | ||
119 | is replaced by a newline. | ||
120 | .It Cm %p | ||
121 | is replaced by the locale's equivalent of either | ||
122 | .Dq Tn AM | ||
123 | or | ||
124 | .Dq Tn PM . | ||
125 | .It Cm \&%R | ||
126 | is replaced by the time in the format | ||
127 | .Dq Li %H:%M . | ||
128 | .It Cm \&%r | ||
129 | is replaced by the locale's representation of 12-hour clock time | ||
130 | using AM/PM notation. | ||
131 | .It Cm \&%T | ||
132 | is replaced by the time in the format | ||
133 | .Dq Li %H:%M:%S . | ||
134 | .It Cm \&%t | ||
135 | is replaced by a tab. | ||
136 | .It Cm \&%S | ||
137 | is replaced by the second as a decimal number (00-60). | ||
138 | .It Cm %s | ||
139 | is replaced by the number of seconds since the Epoch, UCT (see | ||
140 | .Xr mktime 3 ) . | ||
141 | .It Cm \&%U | ||
142 | is replaced by the week number of the year (Sunday as the first day of | ||
143 | the week) as a decimal number (00-53). | ||
144 | .It Cm \&%u | ||
145 | is replaced by the weekday (Monday as the first day of the week) | ||
146 | as a decimal number (1-7). | ||
147 | .It Cm \&%V | ||
148 | is replaced by the week number of the year (Monday as the first day of | ||
149 | the week) as a decimal number (01-53). If the week containing January | ||
150 | 1 has four or more days in the new year, then it is week 1; otherwise | ||
151 | it is week 53 of the previous year, and the next week is week 1. | ||
152 | .It Cm \&%W | ||
153 | is replaced by the week number of the year (Monday as the first day of | ||
154 | the week) as a decimal number (00-53). | ||
155 | .It Cm \&%w | ||
156 | is replaced by the weekday (Sunday as the first day of the week) | ||
157 | as a decimal number (0-6). | ||
158 | .It Cm \&%X | ||
159 | is replaced by the locale's appropriate time representation. | ||
160 | .It Cm \&%x | ||
161 | is replaced by the locale's appropriate date representation. | ||
162 | .It Cm \&%Y | ||
163 | is replaced by the year with century as a decimal number. | ||
164 | .It Cm \&%y | ||
165 | is replaced by the year without century as a decimal number (00-99). | ||
166 | .It Cm \&%Z | ||
167 | is replaced by the time zone name. | ||
168 | .It Cm %% | ||
169 | is replaced by | ||
170 | .Ql % . | ||
171 | .El | ||
172 | .Sh SEE ALSO | ||
173 | .Xr date 1 , | ||
174 | .Xr ctime 3 , | ||
175 | .Xr printf 1 , | ||
176 | .Xr printf 3 | ||
177 | .Sh STANDARDS | ||
178 | The | ||
179 | .Fn strftime | ||
180 | function | ||
181 | conforms to | ||
182 | .St -ansiC . | ||
183 | The | ||
184 | .Ql \&%C , | ||
185 | .Ql \&%D , | ||
186 | .Ql \&%e , | ||
187 | .Ql \&%h , | ||
188 | .Ql \&%k , | ||
189 | .Ql \&%l , | ||
190 | .Ql \&%n , | ||
191 | .Ql \&%r , | ||
192 | .Ql \&%R , | ||
193 | .Ql \&%s . | ||
194 | .Ql \&%t , | ||
195 | .Ql \&%T , | ||
196 | .Ql \&%u , | ||
197 | and | ||
198 | .Ql \&%V | ||
199 | conversion specifications are extensions. | ||
200 | .Sh BUGS | ||
201 | There is no conversion specification for the phase of the moon. | ||