本文整理汇总了C++中CDate::ParseDate方法的典型用法代码示例。如果您正苦于以下问题:C++ CDate::ParseDate方法的具体用法?C++ CDate::ParseDate怎么用?C++ CDate::ParseDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDate
的用法示例。
在下文中一共展示了CDate::ParseDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnReportPeriodSelendok
void CEMStatisticsMajorDiseasesReport::OnReportPeriodSelendok()
{
CString tmpStr;
CDate dte;
UpdateData(true);
int nMonth = ToInt(m_szReportPeriodKey);
if(nMonth > 0 && nMonth <= 12)
{
m_szFromDate.Format(_T("%.4d/%.2d/01"), m_nYear, nMonth);
dte.ParseDate(m_szFromDate);
m_szToDate.Format(_T("%.4d/%.2d/%.2d 23:59"), m_nYear, nMonth, dte.GetMonthLastDay());
}
if(nMonth == 13)
{
m_szFromDate.Format(_T("%.4d/01/01"), m_nYear);
tmpStr.Format(_T("%.4d/03/01"), m_nYear);
dte.ParseDate(tmpStr);
m_szToDate.Format(_T("%.4d/03/%.2d 23:59" ), m_nYear, dte.GetMonthLastDay());
}
if(nMonth == 14)
{
m_szFromDate.Format(_T("%.4d/04/01"), m_nYear);
tmpStr.Format(_T("%.4d/06/01"), m_nYear);
dte.ParseDate(tmpStr);
m_szToDate.Format(_T("%.4d/06/%.2d 23:59"), m_nYear, dte.GetMonthLastDay());
}
if(nMonth == 15)
{
m_szFromDate.Format(_T("%.4d/07/01"), m_nYear);
tmpStr.Format(_T("%.4d/09/01"), m_nYear);
dte.ParseDate(tmpStr);
m_szToDate.Format(_T("%.4d/09/%.2d 23:59"), m_nYear, dte.GetMonthLastDay());
}
if(nMonth == 16)
{
m_szFromDate.Format(_T("%.4d/10/01"), m_nYear);
tmpStr.Format(_T("%.4d/10/01"), m_nYear);
dte.ParseDate(tmpStr);
m_szToDate.Format(_T("%.4d/12/%.2d 23:59"), m_nYear, dte.GetMonthLastDay());
}
if(nMonth == 17)
{
m_szFromDate.Format(_T("%.4d/01/01"), m_nYear);
tmpStr.Format(_T("%.4d/12/01"), m_nYear);
dte.ParseDate(tmpStr);
m_szToDate.Format(_T("%.4d/12/%.2d 23:59"), m_nYear, dte.GetMonthLastDay());
}
UpdateData(false);
}
示例2: AfxGetMainWnd
void CEMOperationFosteringListC12::OnSetWindowEvents(){
CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd();
//m_wndYear.SetEvent(WE_CHANGE, _OnYearChangeFnc);
//m_wndYear.SetEvent(WE_SETFOCUS, _OnYearSetfocusFnc);
//m_wndYear.SetEvent(WE_KILLFOCUS, _OnYearKillfocusFnc);
m_wndYear.SetEvent(WE_CHECKVALUE, _OnYearCheckValueFnc);
m_wndReportPeriod.SetEvent(WE_SELENDOK, _OnReportPeriodSelendokFnc);
//m_wndReportPeriod.SetEvent(WE_SETFOCUS, _OnReportPeriodSetfocusFnc);
//m_wndReportPeriod.SetEvent(WE_KILLFOCUS, _OnReportPeriodKillfocusFnc);
m_wndReportPeriod.SetEvent(WE_SELCHANGE, _OnReportPeriodSelectChangeFnc);
m_wndReportPeriod.SetEvent(WE_LOADDATA, _OnReportPeriodLoadDataFnc);
//m_wndReportPeriod.SetEvent(WE_ADDNEW, _OnReportPeriodAddNewFnc);
m_wndObject.SetEvent(WE_SELENDOK, _OnObjectSelendokFnc);
//m_wndObject.SetEvent(WE_SETFOCUS, _OnObjectSetfocusFnc);
//m_wndObject.SetEvent(WE_KILLFOCUS, _OnObjectKillfocusFnc);
m_wndObject.SetEvent(WE_SELCHANGE, _OnObjectSelectChangeFnc);
m_wndObject.SetEvent(WE_LOADDATA, _OnObjectLoadDataFnc);
//m_wndObject.SetEvent(WE_ADDNEW, _OnObjectAddNewFnc);
//m_wndFromDate.SetEvent(WE_CHANGE, _OnFromDateChangeFnc);
//m_wndFromDate.SetEvent(WE_SETFOCUS, _OnFromDateSetfocusFnc);
//m_wndFromDate.SetEvent(WE_KILLFOCUS, _OnFromDateKillfocusFnc);
m_wndFromDate.SetEvent(WE_CHECKVALUE, _OnFromDateCheckValueFnc);
//m_wndToDate.SetEvent(WE_CHANGE, _OnToDateChangeFnc);
//m_wndToDate.SetEvent(WE_SETFOCUS, _OnToDateSetfocusFnc);
//m_wndToDate.SetEvent(WE_KILLFOCUS, _OnToDateKillfocusFnc);
m_wndToDate.SetEvent(WE_CHECKVALUE, _OnToDateCheckValueFnc);
m_wndPrintPreview.SetEvent(WE_CLICK, _OnPrintPreviewSelectFnc);
m_wndExport.SetEvent(WE_CLICK, _OnExportSelectFnc);
CDate dte;
dte.ParseDate(pMF->GetSysDate());
m_szFromDate = m_szToDate = pMF->GetSysDate();
m_szFromDate += _T("00:00");
m_szToDate += _T("23:59");
m_nYear = dte.GetYear();
m_szReportPeriodKey.Format(_T("%d"), dte.GetMonth());
UpdateData(false);
}