MFC時間簡單比較方法


MFC//時間簡單比較方法

void CMFCsaveListTofileDlg::OnBnClickedButton6()//時間簡單比較方法
{
    // TODO: 在此添加控件通知處理程序代碼
    CTime time = CTime::GetCurrentTime();
    CString strRptTime = time.Format("%Y%m%d%H%M%S");
    CString currentTime1str = time.Format("%Y%m%d");
    MessageBox(currentTime1str);

    CString dateStr2 = _T("20200319");
    if (currentTime1str > dateStr2)
        MessageBox(_T("currentTime1str大於dateStr2"));
    else
        MessageBox(_T("currentTime1str小於dateStr2"));
        
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM