time_t ltime;
struct tm *today;
_tzset(); // time zone 환경변수 세팅
time(<ime); // 1970년 1월 1일 부터경과한 초(Sec) 가져옴
today = localtime(<ime); // tm structure type 사용
printf("%s\n", ctime(<ime));
// tm structure
struct tm {
int tm_sec; /* seconds after the minute - [0,59] */
int tm_min; /* minutes after the hour - [0,59] */
int tm_hour; /* hours since midnight - [0,23] */
int tm_mday; /* day of the month - [1,31] */
int tm_mon; /* months since January - [0,11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday - [0,6] */
int tm_yday; /* days since January 1 - [0,365] */
int tm_isdst; /* daylight savings time flag */
};반응형
'Code review' 카테고리의 다른 글
| [WinApi]Dialog base start 2 (0) | 2009.05.27 |
|---|---|
| [WinApi]Dialog base start (0) | 2009.05.27 |
| [WinApi]GetLogicalDrives() (0) | 2009.05.27 |