struct tm

Programming/C / C++ 2015. 2. 7. 19:03
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

#include <time.h>

 

struct tm
{
        // seconds after the minute - [0,59]
        int tm_sec;

        // minutes after the hour - [0,59]
        int tm_min;

        // hours since midnight - [0,23]
        int tm_hour;

        // day of the month - [1,31]
        int tm_mday;

        // months since January - [0,11]
        int tm_mon;

        // years since 1900
        int tm_year;

        // days since Sunday - [0,6]
        int tm_wday;

        // days since January 1 - [0,365]
        int tm_yday;

        // daylight savings time flag
        int tm_isdst;
};

 

Convert from a struct tm to a time_t function : time_t mktime( struct tm* ptm )


사용 예)

time_t t;
time(&t);
tm* tstruct;
tstruct = localtime(&t);

tstruct->tm_sec = 현재시간 중 초

'Programming > C / C++' 카테고리의 다른 글

strncpy 의 함정  (0) 2015.02.07
XOR Swap  (0) 2015.02.07
Lotto  (0) 2015.02.07
Quick Cast  (0) 2015.02.07
_strtime  (0) 2015.02.07
Posted by 역시인생한방
,