sztime c++
hi ehsanelahimirza!
Use CTime an MFC class.
CTime ct = CTime::GetCurrentTime();
int minute = ct.GetMinute();
int hour = ct.GetHour();
int seconds=ct.GetSecond();
An Microsoft examples:
void CMainFrame::OnUpdateTime(CCmdUI *pCmdUI)
{
CTime t = CTime::GetCurrentTime();
char szTime[6];
int nHour = t.GetHour();
int nMinute = t.GetMinute();
// Base Hours on 12 instead of 24
if (nHour > 12)
nHour = nHour - 12;
wsprintf(szTime, "%i:%02i", nHour, nMinute);
// Now set the text of the pane.
m_wndStatusBar.SetPaneText(
m_wndStatusBar.CommandToIndex(ID_INDICATOR_TIME),
LPCSTR(szTime));
pCmdUI->Enable();
}