티스토리 뷰

MFC

[MFC] CTime을 이용한 시스템 시간 알아오기

개발하는꼬물이 2018. 2. 17. 16:35

** CTime 클래스를 이용하면 현재 시스템 시간을 알아올 수 있고,

   아래와 같이 년, 월, 일, 주, 시, 분, 초 단위로 얻어올 수 있다!

CTime time = CTime::GetCurrentTime();
CString text;
text.Format(_T("%02d%02d%02d%d%02d%02d%02d"), time.GetYear() -
	2000, time.GetMonth(), time.GetDay(), time.GetDayOfWeek() -
	1, time.GetHour(), time.GetMinute(), time.GetSecond());


댓글