|
@@ -20,27 +20,27 @@ int main(int argc, char * argv[])
|
|
|
{
|
|
{
|
|
|
cerr <<
|
|
cerr <<
|
|
|
"Invoke: strftime format\n"
|
|
"Invoke: strftime format\n"
|
|
|
- "Example: strftime \"The date is %Y?%m?%d in ISO format\""
|
|
|
|
|
|
|
+ "Example: strftime \"The date is %Y-%m-%d in ISO format\""
|
|
|
"The format codes are:\n"
|
|
"The format codes are:\n"
|
|
|
" %a Abbreviated weekday name\n"
|
|
" %a Abbreviated weekday name\n"
|
|
|
" %A Full weekday name\n"
|
|
" %A Full weekday name\n"
|
|
|
" %b Abbreviated month name\n"
|
|
" %b Abbreviated month name\n"
|
|
|
" %B Full month name\n"
|
|
" %B Full month name\n"
|
|
|
" %c Date and time representation appropriate for locale\n"
|
|
" %c Date and time representation appropriate for locale\n"
|
|
|
- " %d Day of month as decimal number (01 – 31)\n"
|
|
|
|
|
- " %H Hour in 24-hour format (00 – 23)\n"
|
|
|
|
|
- " %I Hour in 12-hour format (01 – 12)\n"
|
|
|
|
|
- " %j Day of year as decimal number (001 – 366)\n"
|
|
|
|
|
- " %m Month as decimal number (01 – 12)\n"
|
|
|
|
|
- " %M Minute as decimal number (00 – 59)\n"
|
|
|
|
|
|
|
+ " %d Day of month as decimal number (01 - 31)\n"
|
|
|
|
|
+ " %H Hour in 24-hour format (00 - 23)\n"
|
|
|
|
|
+ " %I Hour in 12-hour format (01 - 12)\n"
|
|
|
|
|
+ " %j Day of year as decimal number (001 - 366)\n"
|
|
|
|
|
+ " %m Month as decimal number (01 - 12)\n"
|
|
|
|
|
+ " %M Minute as decimal number (00 - 59)\n"
|
|
|
" %p Current locale's A.M./P.M. indicator for 12-hour clock\n"
|
|
" %p Current locale's A.M./P.M. indicator for 12-hour clock\n"
|
|
|
- " %S Second as decimal number (00 – 59)\n"
|
|
|
|
|
- " %U Week of year as decimal number, with Sunday as first day of week (00 – 53)\n"
|
|
|
|
|
- " %w Weekday as decimal number (0 – 6; Sunday is 0)\n"
|
|
|
|
|
- " %W Week of year as decimal number, with Monday as first day of week (00 – 53)\n"
|
|
|
|
|
|
|
+ " %S Second as decimal number (00 - 59)\n"
|
|
|
|
|
+ " %U Week of year as decimal number, with Sunday as first day of week (00 - 53)\n"
|
|
|
|
|
+ " %w Weekday as decimal number (0 - 6; Sunday is 0)\n"
|
|
|
|
|
+ " %W Week of year as decimal number, with Monday as first day of week (00 - 53)\n"
|
|
|
" %x Date representation for current locale\n"
|
|
" %x Date representation for current locale\n"
|
|
|
" %X Time representation for current locale\n"
|
|
" %X Time representation for current locale\n"
|
|
|
- " %y Year without century, as decimal number (00 – 99)\n"
|
|
|
|
|
|
|
+ " %y Year without century, as decimal number (00 - 99)\n"
|
|
|
" %Y Year with century, as decimal number\n"
|
|
" %Y Year with century, as decimal number\n"
|
|
|
" %z, %Z Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown\n"
|
|
" %z, %Z Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown\n"
|
|
|
" %% Percent sign\n"
|
|
" %% Percent sign\n"
|
|
@@ -62,5 +62,7 @@ int main(int argc, char * argv[])
|
|
|
cerr << "error: buffer overflow\n";
|
|
cerr << "error: buffer overflow\n";
|
|
|
return 1;
|
|
return 1;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ cout << s;
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|