rename svn revision variable to one with underscore, to not pollute
[minix3.git] / commands / zoneinfo / newstrftime.3.txt
blob29ef78b2fcf3c8a01ce64b704f8b98aae11a3042
1 NAME
3      strftime - format date and time
5 SYNOPSIS
6      #include <sys/types.h>
7      #include <time.h>
9      size_t strftime(buf, maxsize, format, timeptr)
10      char *buf;
11      size_t maxsize;
12      const char *format;
13      const struct tm *timeptr
15      cc ... -ltz
17 DESCRIPTION
18      The strftime function formats the information from timeptr
19      into the buffer buf according to the string pointed to by
20      format.
22      The format string consists of zero or more conversion
23      specifications and ordinary characters.  All ordinary
24      characters are copied directly into the buffer.  A
25      conversion specification consists of a percent sign and one
26      other character.
28      No more than maxsize characters are be placed into the
29      array.  If the total number of resulting characters,
30      including the terminating null character, is not more than
31      maxsize, strftime returns the number of characters in the
32      array, not counting the terminating null.  Otherwise, zero
33      is returned.
35      Each conversion specification is replaced by the characters
36      as follows which are then copied into the buffer.
38      %A   is replaced by the locale's full weekday name.
40      %a   is replaced by the locale's abbreviated weekday name.
42      %B   is replaced by the locale's full month name.
44      %b or %h
45           is replaced by the locale's abbreviated month name.
47      %C   is replaced by the century (a year divided by 100 and
48           truncated to an integer) as a decimal number (00-99).
50      %c   is replaced by the locale's appropriate date and time
51           representation.
53      %D   is replaced by the date in the format %m/%d/%y.
55      %d   is replaced by the day of the month as a decimal number
56           (01-31).
58      %e   is replaced by the day of month as a decimal number
59           (1-31); single digits are preceded by a blank.
61      %F   is replaced by the date in the format %Y-%m-%d.
63      %G   is replaced by the ISO 8601 year with century as a
64           decimal number.
66      %g   is replaced by the ISO 8601 year without century as a
67           decimal number (00-99).
69      %H   is replaced by the hour (24-hour clock) as a decimal
70           number (00-23).
72      %I   is replaced by the hour (12-hour clock) as a decimal
73           number (01-12).
75      %j   is replaced by the day of the year as a decimal number
76           (001-366).
78      %k   is replaced by the hour (24-hour clock) as a decimal
79           number (0-23); single digits are preceded by a blank.
81      %l   is replaced by the hour (12-hour clock) as a decimal
82           number (1-12); single digits are preceded by a blank.
84      %M   is replaced by the minute as a decimal number (00-59).
86      %m   is replaced by the month as a decimal number (01-12).
88      %n   is replaced by a newline.
90      %p   is replaced by the locale's equivalent of either AM or
91           PM.
93      %R   is replaced by the time in the format %H:%M.
95      %r   is replaced by the locale's representation of 12-hour
96           clock time using AM/PM notation.
98      %S   is replaced by the second as a decimal number (00-60).
100      %s   is replaced by the number of seconds since the Epoch,
101           UTC (see mktime(3)).
103      %T   is replaced by the time in the format %H:%M:%S.
105      %t   is replaced by a tab.
107      %U   is replaced by the week number of the year (Sunday as
108           the first day of the week) as a decimal number (00-53).
110      %u   is replaced by the weekday (Monday as the first day of
111           the week) as a decimal number (1-7).
113      %V   is replaced by the week number of the year (Monday as
114           the first day of the week) as a decimal number (01-53).
115           If the week containing January 1 has four or more days
116           in the new year, then it is week 1; otherwise it is
117           week 53 of the previous year, and the next week is week
118           1.
120      %W   is replaced by the week number of the year (Monday as
121           the first day of the week) as a decimal number (00-53).
123      %w   is replaced by the weekday (Sunday as the first day of
124           the week) as a decimal number (0-6).
126      %X   is replaced by the locale's appropriate time
127           representation.
129      %x   is replaced by the locale's appropriate date
130           representation.
132      %Y   is replaced by the year with century as a decimal
133           number.
135      %y   is replaced by the year without century as a decimal
136           number (00-99).
138      %Z   is replaced by the time zone name, or by the empty
139           string if this is not determinable.
141      %z   is replaced by the offset from UTC in the format +HHMM
142           or -HHMM as appropriate, with positive values
143           representing locations east of Greenwich, or by the
144           empty string if this is not determinable.
146      %%   is replaced by a single %.
148      %+   is replaced by the date and time in date(1) format.
150 SEE ALSO
151      date(1), getenv(3), newctime(3), newtzset(3), time(2),
152      tzfile(5)