¿øÇü |
VOID GetLocalTime(LPSYSTEMTIME lpSystemTime); |
MFC ¿øÇü |
struct tm* CTime::GetLocalTm( struct tm* ptm = NULL ) const; |
Àμö |
¢ºlpSystemTime : ÇöÀç ·ÎÄà ½Ã°£À» ´ëÀÔ¹ÞÀ» SYSTEMTIME ±¸Á¶Ã¼ |
¸®ÅÏ |
¾øÀ½ |
¼³¸í |
·ÎÄà ½Ã°£À» Á¶»çÇØ ÁØ´Ù. ·ÎÄà ½Ã°£À̶õ ½Ã½ºÅÛÀÌ À¯ÁöÇÏ´Â ½Ã½ºÅÛ ½Ã°£(UTC)¿¡¼ ÇöÀç ÄÄÇ»ÅÍ°¡ ½ÇÇàµÇ°í ÀÖ´Â ½Ã°£´ë¿Í Àϱ¤Àý¾à ¼³Á¤À» °è»êÇÏ¿© º¯È¯ÇÑ ½Ã°£ÀÌ´Ù. ´ëÇѹα¹ÀÇ ·ÎÄà ½Ã°£Àº UTC ½Ã°£º¸´Ù 9½Ã°£ ´õ ºü¸£¹Ç·Î ½Ã½ºÅÛ ½Ã°£¿¡¼ 9½Ã°£¸¸Å ´õÇØÁÖ¾î¾ß ·ÎÄà ½Ã°£ÀÌ ±¸ÇØÁø´Ù. ÀϹÝÀûÀ¸·Î ÇöÁö ½Ã°£À̶ó°í Çϸé ÀÌ ÇÔ¼ö·Î ±¸ÇØÁö´Â ·ÎÄà ½Ã°£À» ÀǹÌÇÑ´Ù. ´ÙÀ½ ¿¹Á¦´Â ÇöÀç ½Ã°£À» ±¸ÇØ Ãâ·ÂÇØ ÁØ´Ù. LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam) { HDC hdc; PAINTSTRUCT ps; SYSTEMTIME st; TCHAR str[128]; switch(iMessage) { case WM_PAINT: hdc=BeginPaint(hWnd, &ps); GetLocalTime(&st); wsprintf(str, "ÇöÀç ½Ã°£Àº %d¿ù %dÀÏ %d½Ã %dºÐÀÔ´Ï´Ù", st.wMonth, st.wDay, st.wHour, st.wMinute); TextOut(hdc,10,10,str,lstrlen(str)); EndPaint(hWnd, &ps); return 0; case WM_DESTROY: PostQuitMessage(0); return 0; } return(DefWindowProc(hWnd,iMessage,wParam,lParam)); } SYSTEMTIME ÇüÀÇ ±¸Á¶Ã¼¸¦ ¼±¾ðÇÏ°í ÀÌ ±¸Á¶Ã¼ÀÇ Æ÷ÀÎÅ͸¦ GetLocalTime ÇÔ¼ö·Î Àü´ÞÇÏ¸é ·ÎÄà ½Ã°£ÀÌ ±¸Á¶Ã¼·Î ¸®ÅϵȴÙ. ±¸Á¶Ã¼ÀÇ °¢ ¸â¹ö´Â ½Ã°£°ú ³¯Â¥¸¦ ´ã°í ÀÖÀ¸¹Ç·Î ¿øÇÏ´Â Á¤º¸¸¦ »©³» ¹®ÀÚ¿·Î Á¶¸³ÇÑ ÈÄ Ãâ·ÂÇÏ¸é µÈ´Ù. ½ÇÇà °á°ú´Â ´ÙÀ½°ú °°´Ù. |
Âü°íÇÔ¼ö |
SetLocalTime : ·ÎÄà ½Ã°£À» º¯°æÇÑ´Ù. |
Ç÷§Æû | 95ÀÌ»ó |
ÂüÁ¶ |
|
written by http://www.winapi.co.kr
|