time.h ¶
๋ด๋น : ํ์ค์
time.h - time ๊ณผ date ์ ๊ด๋ จ๋ ํจ์
tiem ๊ตฌ์กฐ์ฒด (tm) ¶
time ํจ์๊ฐ์ ๋๋ต์ ์ธ ๋ค์ด์ด๊ทธ๋จ ¶
ํจ์ (Functions) ¶
ํจ ์ ๋ช | ๋ด ์ฉ |
char *asctime(const struct tm *timeptr); | tm ๊ตฌ์กฐ์ฒด๋ฅผ ๋ฌธ์์ด๋ก ๋ฐ๊พผ๋ค. |
clock_t clock(void); | processor clock time ์ ๋ฐํํ๋ค |
char *ctime(const time_t *timer); | |
double difftime(time_t time1, time_t time2); | ๋ ์๊ฐ๊ฐ์ ์ฐจ์ด๋ฅผ ๊ณ์ฐํ๋ค. |
struct tm *gmtime(const time_t *timer); | timer ๋ฅผ GMT์ ์ ๊ฐํ์ฌ tm ๊ตฌ์กฐ์ฒด์ ๊ฐ์ผ๋ก ๋ณํํ๋ค. |
struct tm *localtime(const time_t *timer); | timer๋ฅผ local time ์ ์ ๊ฐํ์ฌ tm ๊ตฌ์กฐ์ฒด์ ๊ฐ์ผ๋ก ๋ณํํ๋ค. |
time_t mktime(struct tm *timeptr); | tm ๊ตฌ์กฐ์ฒด๋ฅผ time_t ์ ๊ฐ์ผ๋ก ๋ณํํ๋ค. |
size_t strftime(char *str, size_t maxsize, const char *format, const struct tm *timeptr); | time ๊ณผ date ๋ฅผ ๋ฌธ์์ด๋ก ๋ฐ๊พผ๋ค. |
time_t time(time_t *timer); | ํ์ฌ์ ์๊ฐ์ time_t ํํ๋ก ๋ณํํ๋ค. |
struct tm *getdate(const char *); | ๋ฌธ์์ด์ tm ๊ตฌ์กฐ์ฒด๋ก ๋ณํํ๋ค. |