Formats a time string.
#include <time.h> size_t strftime (char *string, size_t maxsize,
const char *format, const struct tm *timedate);
#include <wchar.h>
size_t wcsftime(wchar_t *string, size_t maxsize,
const wchar_t *format, const struct tm *timedate);
string
maxsize
format
timedate
Format specifications have a preceding percent sign (%); preceding characters are copied unchanged to string. The LC_TIME category of the current locale affects the output formatting of strftime.
| Format | Description |
|---|---|
| %a | Abbreviated weekday name |
| %A | Full weekday name |
| %b | Abbreviated month name |
| %B | Full month name |
| %c | Date and time representation appropriate for the locale |
| %d | Day of the month as a decimal number (01-31) |
| %H | Hour in 24-hour format (00-23) |
| %I | Hour in 12-hour format (01-12) |
| %j | Day of the year as a decimal number (001-366) |
| %m | Month as a decimal number (01-12) |
| %M | Minute as a decimal number (00-59) |
| %p | Current locale's AM/PM indicator for a 12-hour clock |
| %S | Second as a decimal number (00-61) |
| %U | Week of year as decimal number; Sunday is first day of week (00-53) |
| %w | Weekday as a decimal number (06; Sunday is 0) |
| %W | Week of year as decimal number; Monday is first day of week (00-53) |
| %x | Date representation for current locale |
| %X | Time representation for current locale |
| %y | Year without the century as a decimal number (00-99) |
| %Y | Year with the century as a decimal number |
| %z | Timezone name or abbreviation; no characters if timezone is unknown |
| %% | Percent sign |
maxsize.
maxsize.
tchar.h routine |
_UNICODE not defined |
_UNICODE defined |
|---|---|---|
| _tcsftime | strftime | wcsftime |
| Versions | Defined in | Include | Link to |
|---|---|---|---|
| INtime 3.0 INtime 6.0 (wide-character and generic text versions) |
intime/rt/include/time.h intime/rt/include/wchar.h intime/rt/include/tchar.h |
time.h wchar.h tchar.h |
clib.lib |