1. 四个与时间相关的类型: clock_t, time_t, size_t, tm
2. tm struct
```
struct tm
{
int tm_sec; // 0 - 59
int tm_min; // 0 - 59
int tm_hour; // 0 - 23
int tm_mday; // 1 - 31
int tm_mon; // 0 - 11
int tm_year; // since 1900
int tm_wday; // 0 - 6 (sunday = 0)
int tm_yday; // 0 - 365
int tm_isdst; // 夏令时
};
```
Functions
1. time_t time(time_t *time);
2. char *ctime(const time_t *time); // Eg. Mon Apr 02 10.15.36 2018\n\0
3. struct tm *localtime(const time_t *time);
4. clock_t clock(void);
5. char *asctime(const struct tm *time); // Eg. Mon Apr 02 10.15.36 2018\n\0
6. struct tm *gmtime(const time_t *time);
7. time_t mktime(struct tm *time);
8. double difftime(time_t time1, time_t time2);
9. size_t strftime(char *str, size_t maxsize, const char *format, const struct tm *timeptr);
10. string time format
%a short weekday
%A full weekday
%b short month
%B full month
%c date and time Eg. Mon Apr 02 10.15.36 2018
%d month day
%H 24h format
%I 12h format
%j year day
%m month 01-12
%M minutes 00-59
%p AM or PM
%S second 00-61
%U week of year (the first day is sunday)
%w weekday 0-6 \
%W week of year (the first day is monday)
%x date Eg. 08/19/12
%X time Eg. 10.15.36
%y short year 00-99 (since 1900)
%Y full year
%Z timezone name
%% display a %