p The .Fa format string consists of zero or more conversion specifications and ordinary characters. All ordinary characters are copied directly into the buffer. A conversion specification consists of a percent sign .Ql % and one other character.
p No more than .Fa maxsize characters will be placed into the array. If the total number of resulting characters, including the terminating null character, is not more than .Fa maxsize , .Fn strftime returns the number of characters in the array, not counting the terminating null. Otherwise, zero is returned.
p Each conversion specification is replaced by the characters as follows which are then copied into the buffer. l -tag -width "xxxx" t Cm %A is replaced by the locale's full weekday name. t Cm %a is replaced by the locale's abbreviated weekday name. t Cm %B is replaced by the locale's full month name. t Cm %b No or Cm %h is replaced by the locale's abbreviated month name. t Cm %C is replaced by the century (a year divided by 100 and truncated to an integer) as a decimal number [00,99]. t Cm %c is replaced by the locale's appropriate date and time representation. t Cm %D is replaced by the date in the format .Dq Li %m/%d/%y . t Cm %d is replaced by the day of the month as a decimal number [01,31]. t Cm %e is replaced by the day of month as a decimal number [1,31]; single digits are preceded by a blank. t Cm %H is replaced by the hour (24-hour clock) as a decimal number [00,23]. t Cm %I is replaced by the hour (12-hour clock) as a decimal number [01,12]. t Cm %j is replaced by the day of the year as a decimal number [001,366]. t Cm %k is replaced by the hour (24-hour clock) as a decimal number [0,23]; single digits are preceded by a blank. t Cm %l is replaced by the hour (12-hour clock) as a decimal number [1,12]; single digits are preceded by a blank. t Cm %M is replaced by the minute as a decimal number [00,59]. t Cm %m is replaced by the month as a decimal number [01,12]. t Cm %n is replaced by a newline. t Cm %p is replaced by the locale's equivalent of either .Dq Tn AM or .Dq Tn PM . t Cm %R is replaced by the time in the format .Dq Li %H:%M . t Cm %r is replaced by the locale's representation of 12-hour clock time using AM/PM notation. t Cm %T is replaced by the time in the format .Dq Li %H:%M:%S . t Cm %t is replaced by a tab. t Cm %S is replaced by the second as a decimal number [00,61]. t Cm %s is replaced by the number of seconds since the Epoch, UCT (see .Xr mktime 3 ) . t Cm %U is replaced by the week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. t Cm %u is replaced by the weekday (Monday as the first day of the week) as a decimal number [1,7]. t Cm %V is replaced by the week number of the year (Monday as the first day of the week) as a decimal number [01,53]. If the week containing January 1 has four or more days in the new year, then it is week 1; otherwise it is week 53 of the previous year, and the next week is week 1. t Cm %W is replaced by the week number of the year (Monday as the first day of the week) as a decimal number [00,53]. t Cm %w is replaced by the weekday (Sunday as the first day of the week) as a decimal number [0,6]. t Cm %X is replaced by the locale's appropriate time representation. t Cm %x is replaced by the locale's appropriate date representation. t Cm %Y is replaced by the year with century as a decimal number. t Cm %y is replaced by the year without century as a decimal number [00,99]. t Cm %Z is replaced by the time zone name. t Cm %% is replaced by .Ql % . .El .Sh SEE ALSO .Xr date 1 , .Xr ctime 3 , .Xr strptime 3 , .Xr printf 1 , .Xr printf 3 .Sh STANDARDS The .Fn strftime function conforms to .St -ansiC . The .Ql %C , .Ql %D , .Ql %e , .Ql %h , .Ql %k , .Ql %l , .Ql %n , .Ql %r , .Ql %R , .Ql %s . .Ql %t , .Ql %T , .Ql %u , and .Ql %V conversion specifications are extensions. .Sh BUGS There is no conversion specification for the phase of the moon.