我看了一些关于 COleDateTime用法的贴子,也看MSDN,不过还是没有解决问题,请大家帮忙.
m_brith.GetCurrentTime();//m_brith 为关联到一个日期控件的COleDateTime类型变量
strbrith=m_brith.Format("%Y-%m-%d %H:%M:%S");//在此处出错
m_brith.GetCurrentTime();//m_brith 为关联到一个日期控件的COleDateTime类型变量
strbrith=m_brith.Format("%Y-%m-%d %H:%M:%S");//在此处出错
ti=ti.GetCurrentTime();//这样写,我调试的时候程序就停在这里不走了,为什么呢?
CString str=ti.Format(_T("123%Y-%m-%d %H:%M:%S"));
AfxMessageBox(str);
ti=COleDateTime::GetCurrentTime();//这样写,我调试的时候程序就停在这里不走了,为什么呢?
CString str=ti.Format(_T("123%Y-%m-%d %H:%M:%S"));
AfxMessageBox(str);
COleDateTime ti;
ti=COleDateTime::GetCurrentTime();//这样写
CString str=ti.Format(_T("123%Y-%m-%d %H:%M:%S"));
AfxMessageBox(str);
ti=COleDateTime::GetCurrentTime();//这句这样写就可以了,其他的不用改
CString str=ti.Format("%Y-%m-%d %H:%M:%S"));
AfxMessageBox(str);[/code]
{
CString strDate = InvoiceDate.Format("%Y%m%d");
}