원문 : 
http://blog.naver.com/scoolde/130175573216
현재 타임 구하기
현재시간을 구하는 방법에도 여러가지가 있다.
 MFC에서 제공해주는 API,  C에서 사용할 수 있는 time 등 차근차근 Time에 관련되어 현재 시간을 구하고,
최대 밀리세컨드 또는 정확한 타이머를 위하여 정리 하였다.
현재 시간 구하기 목록
1. CTime
2. SYSTEMTIME
1. cTime 
 
CTime thetime; 
thetime = CTime::GetCurrentTime(); 
 
CString str; 
출력 
str.Format(" %d, %d, %d \n", thetime.GetHour(), thetime.GetMinute(), thetime.GetSecond()); | 
 
03 | GetLocalTime(&curTime); | 
 
05 | strCurTime.Format("%d년 %d월 %d일 %d:%d:%d ", curTime.wYear, curTime.wMonth, curTime.wDay, curTime.wHour, curTime.wMinute, curTime.wSecond); | 
 
08 | typedef struct _SYSTEMTIME { | 
 
C에서 현재 시간 구하기
#include <stdio.h>
#include <time.h>
int main( void)
{
   time_t   current_time;
   time( ¤t_time);
   printf( "%ldn", current_time);
   printf( ctime( ¤t_time));
   return 0;
}
]$ ./a.out
1184746481
Wed Jul 18 17:14:41 2007
]$
 
댓글 없음:
댓글 쓰기