summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strftime.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/strftime.3')
-rw-r--r--src/lib/libc/string/strftime.3201
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
49The
50.Fn strftime
51function formats the information from
52.Fa timeptr
53into the buffer
54.Fa buf
55according to the string pointed to by
56.Fa format .
57.Pp
58The
59.Fa format
60string consists of zero or more conversion specifications and
61ordinary characters.
62All ordinary characters are copied directly into the buffer.
63A conversion specification consists of a percent sign
64.Ql %
65and one other character.
66.Pp
67No more than
68.Fa maxsize
69characters will be placed into the array.
70If the total number of resulting characters, including the terminating
71null character, is not more than
72.Fa maxsize ,
73.Fn strftime
74returns the number of characters in the array, not counting the
75terminating null.
76Otherwise, zero is returned.
77.Pp
78Each conversion specification is replaced by the characters as
79follows which are then copied into the buffer.
80.Bl -tag -width "xxxx"
81.It Cm \&%A
82is replaced by the locale's full weekday name.
83.It Cm %a
84is replaced by the locale's abbreviated weekday name.
85.It Cm \&%B
86is replaced by the locale's full month name.
87.It Cm \&%b No or Cm \&%h
88is replaced by the locale's abbreviated month name.
89.It Cm \&%C
90is replaced by the century (a year divided by 100 and truncated to an integer)
91as a decimal number (00-99).
92.It Cm \&%c
93is replaced by the locale's appropriate date and time representation.
94.It Cm \&%D
95is replaced by the date in the format
96.Dq Li %m/%d/%y .
97.It Cm \&%d
98is replaced by the day of the month as a decimal number (01-31).
99.It Cm \&%e
100is replaced by the day of month as a decimal number (1-31);
101single digits are preceded by a blank.
102.It Cm \&%H
103is replaced by the hour (24-hour clock) as a decimal number (00-23).
104.It Cm \&%I
105is replaced by the hour (12-hour clock) as a decimal number (01-12).
106.It Cm \&%j
107is replaced by the day of the year as a decimal number (001-366).
108.It Cm \&%k
109is replaced by the hour (24-hour clock) as a decimal number (0-23);
110single digits are preceded by a blank.
111.It Cm \&%l
112is replaced by the hour (12-hour clock) as a decimal number (1-12);
113single digits are preceded by a blank.
114.It Cm \&%M
115is replaced by the minute as a decimal number (00-59).
116.It Cm %m
117is replaced by the month as a decimal number (01-12).
118.It Cm %n
119is replaced by a newline.
120.It Cm %p
121is replaced by the locale's equivalent of either
122.Dq Tn AM
123or
124.Dq Tn PM .
125.It Cm \&%R
126is replaced by the time in the format
127.Dq Li %H:%M .
128.It Cm \&%r
129is replaced by the locale's representation of 12-hour clock time
130using AM/PM notation.
131.It Cm \&%T
132is replaced by the time in the format
133.Dq Li %H:%M:%S .
134.It Cm \&%t
135is replaced by a tab.
136.It Cm \&%S
137is replaced by the second as a decimal number (00-60).
138.It Cm %s
139is replaced by the number of seconds since the Epoch, UCT (see
140.Xr mktime 3 ) .
141.It Cm \&%U
142is replaced by the week number of the year (Sunday as the first day of
143the week) as a decimal number (00-53).
144.It Cm \&%u
145is replaced by the weekday (Monday as the first day of the week)
146as a decimal number (1-7).
147.It Cm \&%V
148is replaced by the week number of the year (Monday as the first day of
149the week) as a decimal number (01-53). If the week containing January
1501 has four or more days in the new year, then it is week 1; otherwise
151it is week 53 of the previous year, and the next week is week 1.
152.It Cm \&%W
153is replaced by the week number of the year (Monday as the first day of
154the week) as a decimal number (00-53).
155.It Cm \&%w
156is replaced by the weekday (Sunday as the first day of the week)
157as a decimal number (0-6).
158.It Cm \&%X
159is replaced by the locale's appropriate time representation.
160.It Cm \&%x
161is replaced by the locale's appropriate date representation.
162.It Cm \&%Y
163is replaced by the year with century as a decimal number.
164.It Cm \&%y
165is replaced by the year without century as a decimal number (00-99).
166.It Cm \&%Z
167is replaced by the time zone name.
168.It Cm %%
169is 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
178The
179.Fn strftime
180function
181conforms to
182.St -ansiC .
183The
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 ,
197and
198.Ql \&%V
199conversion specifications are extensions.
200.Sh BUGS
201There is no conversion specification for the phase of the moon.