BSD 4_3_Reno release
[unix-history] / usr / share / man / cat3 / strftime.0
STRFTIME(3) UNIX Programmer's Manual STRFTIME(3)
N\bNA\bAM\bME\bE
strftime - format date and time
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<s\bsy\bys\bs/\b/t\bty\byp\bpe\bes\bs.\b.h\bh>\b>
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<t\bti\bim\bme\be.\b.h\bh>\b>
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<s\bst\btr\bri\bin\bng\bg.\b.h\bh>\b>
s\bsi\biz\bze\be_\b_t\bt
s\bst\btr\brf\bft\bti\bim\bme\be(\b(c\bch\bha\bar\br *\b*s\bs,\b, s\bsi\biz\bze\be_\b_t\bt m\bma\bax\bxs\bsi\biz\bze\be,\b, c\bco\bon\bns\bst\bt c\bch\bha\bar\br *\b*f\bfo\bor\brm\bma\bat\bt,\b,
c\bco\bon\bns\bst\bt s\bst\btr\bru\buc\bct\bt t\btm\bm *\b*t\bti\bim\bme\bep\bpt\btr\br)\b);\b;
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
The _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be function formats the information from _\bt_\bi_\bm_\be_\bp_\bt_\br
into the buffer _\bb_\bu_\bf according to the string pointed to by
_\bf_\bo_\br_\bm_\ba_\bt.
The _\bf_\bo_\br_\bm_\ba_\bt string consists of zero or more conversion
specifications and ordinary characters. All ordinary char-
acters are copied directly into the buffer. A conversion
specification consists of a percent sign (``%'') and one
other character.
No more than _\bm_\ba_\bx_\bs_\bi_\bz_\be characters will be placed into the
array. If the total number of resulting characters, includ-
ing the terminating null character, is not more than _\bm_\ba_\bx_\b-
_\bs_\bi_\bz_\be, _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be returns the number of characters in the
array, not counting the terminating null. Otherwise, zero
is returned.
Each conversion specification is replaced by the characters
as follows which are then copied into the buffer.
%\b%A\bA is replaced by the full weekday name.
%\b%a\ba is replaced by the abbreviated weekday name, where the
abbreviation is the first three characters.
%\b%B\bB is replaced by the full month name.
%\b%b\bb o\bor\br %\b%h\bh
is replaced by the abbreviated month name, where the
abbreviation is the first three characters.
%\b%C\bC is equivalent to ``%a %b %e %H:%M:%S %Y'' (the format
produced by _\ba_\bs_\bc_\bt_\bi_\bm_\be(3).
%\b%c\bc is equivalent to ``%m/%d/%y''.
%\b%D\bD is replaced by the date in the format ``mm/dd/yy''.
%\b%d\bd is replaced by the day of the month as a decimal number
Printed 7/27/90 1Q 1
STRFTIME(3) UNIX Programmer's Manual STRFTIME(3)
(01-31).
%\b%e\be is replaced by the day of month as a decimal number
(1-31); single digits are preceded by a blank.
%\b%H\bH is replaced by the hour (24-hour clock) as a decimal
number (00-23).
%\b%I\bI is replaced by the hour (12-hour clock) as a decimal
number (01-12).
%\b%j\bj is replaced by the day of the year as a decimal number
(001-366).
%\b%k\bk is replaced by the hour (24-hour clock) as a decimal
number (0-23); single digits are preceded by a blank.
%\b%l\bl is replaced by the hour (12-hour clock) as a decimal
number (01-12); single digits are preceded by a blank.
%\b%M\bM is replaced by the minute as a decimal number (00-59).
%\b%m\bm is replaced by the month as a decimal number (01-12).
%\b%n\bn is replaced by a newline.
%\b%p\bp is replaced by either ``AM'' or ``PM'' as appropriate.
%\b%R\bR is equivalent to ``%H:%M''.
%\b%r\br is equivalent to ``%I:%M:%S %p''.
%\b%t\bt is replaced by a tab.
%\b%S\bS is replaced by the second as a decimal number (00-60).
%\b%T\bT o\bor\br %\b%X\bX
is equivalent to ``%H:%M:%S''.
%\b%U\bU is replaced by the week number of the year (Sunday as
the first day of the week) as a decimal number (00-53).
%\b%W\bW is replaced by the week number of the year (Monday as
the first day of the week) as a decimal number (00-53).
%\b%w\bw is replaced by the weekday (Sunday as the first day of
the week) as a decimal number (0-6).
%\b%x\bx is equivalent to ``%m/%d/%y %H:%M:%S''.
%\b%Y\bY is replaced by the year with century as a decimal
number.
Printed 7/27/90 2Q 2
STRFTIME(3) UNIX Programmer's Manual STRFTIME(3)
%\b%y\by is replaced by the year without century as a decimal
number (00-99).
%\b%Z\bZ is replaced by the time zone name.
%\b%%\b% is replaced by ``%''.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
date(1), ctime(3), printf(1), printf(3)
S\bST\bTA\bAN\bND\bDA\bAR\bRD\bDS\bS
S\bSt\btr\brf\bft\bti\bim\bme\be conforms to ANSI X3.159-1989 (``ANSI C'').
Printed 7/27/90 3Q 3