Đang chuẩn bị liên kết để tải về tài liệu:
The C++ Programming Language Third Edition phần 10
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
có thể sản xuất trong một thời gian hợp lý. Khi cách tiếp cận khác nhau cạnh tranh và giám đốc điều hành không thực sự hiểu hoặc quan tâm đến "các chi tiết, trình bày" có thể trở thành cuộc thi nằm, trong đó các nhóm trình bày các hệ thống hoành tráng nhất được để giữ cho công việc của mình. | Section D.4.4.3 Date and Time Output 909 actual output and may contain the following special-purpose format specifiers a abbreviated weekday name e.g. Sat A full weekday name e.g. Saturday b abbreviated month name e.g. Feb B full month name e.g. February c date and time e.g. Sat Feb 06 21 46 05 1999 d day of month 01 31 e.g. 06 H 24-hour clock hour 00 23 e.g. 21 j 12-hour clock hour 01 12 e.g. 09 j day of year 001 366 e.g. 037 m month of year 01 12 e.g. 02 M minute of hour 00 59 e.g. 48 p a.m. p.m. indicator for 12-hour clock e.g. PM S second of minute 00 61 e.g. 40 U week of year 00 53 starting with Sunday e.g. 05 the first Sunday starts week 1 w day of week 0 6 0 means Sunday e.g. 6 W week of year 00 53 starting with Monday e.g. 05 the first Monday starts week 1 x date e.g. 02 06 99 X time e.g. 21 48 40 y year without century 00 99 e.g. 99 Y year e.g. 1999 Z time zone indicator e.g. EST if the time zone is known This long list of very specialized formatting rules could be used as an argument for the use of extensible I O systems. However as with most specialized notations it is adequate for its task and often even convenient. In addition to these formatting directives most implementations support modifiers such as an integer specifying a field width 21.8 10X. Modifiers for the time-and-date formats are not part of the C standard but some platform standards such as POSIX require them. Consequently modifiers can be difficult to avoid even if their use isn t perfectly portable. The sprintf-like 21.8 function strftime from ctime or time .h produces output using the time and date format directives size_t strftime char s size_t max const char format const tm tmp This function places a maximum of m ax characters from tmp and the form at into s according the form at. For example int main const in t max 2 0 sloppy hope strftime will never produce more than 20 characters char buf max time _t t time 0 strftime b uf max A n localtim e t cout b uf 910 Locales Appendix D On a