CTime time;
CString m_time;
void CtimeDlg::OnBnClickedButton1()
{
// TODO: 在此添加控件通知处理程序代码
SetTimer(1,1000,NULL);
}
void CtimeDlg::OnTimer(UINT_PTR nIDEvent)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
time=CTime::GetCurrentTime();
CString s=time.Format("%Y-%m-%d %H:%M:%S");
m_time =s;
GetDlgItem(IDC_EDIT1)->SetWindowText(m_time);
UpdateData(FALSE);
CDialogEx::OnTimer(nIDEvent);
}