本文整理汇总了C++中COleDateTimeSpan::GetHours方法的典型用法代码示例。如果您正苦于以下问题:C++ COleDateTimeSpan::GetHours方法的具体用法?C++ COleDateTimeSpan::GetHours怎么用?C++ COleDateTimeSpan::GetHours使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COleDateTimeSpan
的用法示例。
在下文中一共展示了COleDateTimeSpan::GetHours方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestModifiedTime
void TestDominoDocArtifact::TestModifiedTime()
{
COleDateTime currentTime = COleDateTime::GetCurrentTime();
DomDocHelper domDocHelper(TEST_ARTIFACT_FILE);
DominoDocArtifact validArtifact(m_spLibrary, domDocHelper.DocumentId, domDocHelper.GetVersionLabel());
COleDateTime dominoDocmodifiedTime = validArtifact.ModifiedTime;
assertTest(COleDateTime::invalid != dominoDocmodifiedTime.GetStatus());
assertTest(COleDateTime::null != dominoDocmodifiedTime.GetStatus());
COleDateTimeSpan OleDateTimeSpan = dominoDocmodifiedTime - currentTime;
assertTest(0 == OleDateTimeSpan.GetHours());
assertTest(2 >= OleDateTimeSpan.GetMinutes());
}
示例2: OnInitDialog
BOOL COptionsStats::OnInitDialog()
{
CPropertyPage::OnInitDialog();
CTime time(CGetSetOptions::GetTotalDate());
m_eAllDate = time.Format("%m/%d/%Y %I:%M %p");
m_eAllCopies.Format(_T("%d"), CGetSetOptions::GetTotalCopyCount());
m_eAllPastes.Format(_T("%d"), CGetSetOptions::GetTotalPasteCount());
CTime time2(CGetSetOptions::GetTripDate());
m_eTripDate = time2.Format("%m/%d/%Y %I:%M %p");
m_eTripCopies.Format(_T("%d"), CGetSetOptions::GetTripCopyCount());
m_eTripPastes.Format(_T("%d"), CGetSetOptions::GetTripPasteCount());
m_eClipsSent.Format(_T("%d"), theApp.m_lClipsSent);
m_eClipsRecieved.Format(_T("%d"), theApp.m_lClipsRecieved);
m_eLastStarted = theApp.m_oldtStartUp.Format(_T("%m/%d/%y %I:%M:%S"));
if(theApp.m_oldtStartUp.GetHour() > 12)
m_eLastStarted += " PM";
else
m_eLastStarted += " AM";
COleDateTimeSpan span = COleDateTime::GetCurrentTime() - theApp.m_oldtStartUp;
CString csSpan;
csSpan.Format(_T(" - %d.%d.%d (D.H.M)"), (long)span.GetTotalDays(), span.GetHours(), span.GetMinutes());
m_eLastStarted += csSpan;
try
{
m_eSavedCopies.Format(_T("%d"), theApp.m_db.execScalar(_T("SELECT COUNT(lID) FROM Main")));
m_eSavedCopyData.Format(_T("%d"), theApp.m_db.execScalar(_T("SELECT COUNT(lID) FROM Data")));
}
CATCH_SQLITE_EXCEPTION
__int64 size = FileSize(GetDBName());
const int MAX_FILE_SIZE_BUFFER = 255;
TCHAR szFileSize[MAX_FILE_SIZE_BUFFER];
StrFormatByteSize(size, szFileSize, MAX_FILE_SIZE_BUFFER);
m_eDatabaseSize = szFileSize;
UpdateData(FALSE);
theApp.m_Language.UpdateOptionStats(this);
return TRUE;
}