本文整理汇总了C++中CDate::GetYear方法的典型用法代码示例。如果您正苦于以下问题:C++ CDate::GetYear方法的具体用法?C++ CDate::GetYear怎么用?C++ CDate::GetYear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDate
的用法示例。
在下文中一共展示了CDate::GetYear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnYearCheckValue
/*void CEMGeneralSoldierExamination::OnYearKillfocus(){
} */
int CEMGeneralSoldierExamination::OnYearCheckValue()
{
UpdateData(TRUE);
if (m_nYear > 0)
{
CDateTime dt;
CDate date;
CString szTemp;
dt.ParseDateTime(m_szFromDate);
date = dt.GetDate();
if (date.GetYear() != 1752)
{
dt.SetDate(m_nYear, date.GetMonth(), date.GetDay());
m_szFromDate = dt.GetDateTime();
szTemp.Format(_T("%.2d/%.2d/%.4d %.2d:%.2d"), dt.GetDate().GetDay(), dt.GetDate().GetMonth(),
dt.GetDate().GetYear(), dt.GetTime().GetHour(), dt.GetTime().GetMinute());
m_wndFromDate.SetWindowText(szTemp);
}
dt.ParseDateTime(m_szToDate);
date = dt.GetDate();
if (date.GetYear() != 1752)
{
dt.SetDate(m_nYear, date.GetMonth(), date.GetDay());
m_szToDate = dt.GetDateTime();
szTemp.Format(_T("%.2d/%.2d/%.4d %.2d:%.2d"), dt.GetDate().GetDay(), dt.GetDate().GetMonth(),
dt.GetDate().GetYear(), dt.GetTime().GetHour(), dt.GetTime().GetMinute());
m_wndToDate.SetWindowText(szTemp);
}
}
UpdateData(FALSE);
return 0;
}
示例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);
}
示例3: ToString
core::string CDate::ToString(const CDate& date)
{
std::ostringstream stream;
stream << date.GetDay() << mT("/") << date.GetMonth() << mT("/") << date.GetYear();
return stream.str();
}