这篇教程C++ COleDateTime函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中COleDateTime函数的典型用法代码示例。如果您正苦于以下问题:C++ COleDateTime函数的具体用法?C++ COleDateTime怎么用?C++ COleDateTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了COleDateTime函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: dtvoid CBCGPRecurrenceRuleYearly::CorrectStart (){ COleDateTime dt (GetDateStart ()); int y = dt.GetYear (); int m = m_Type == BCGP_REC_RULE_YEARLY_TYPE_DAY ? m_dwDayMonth : m_dwDayTypeMonth; int d = GetPossibleDay (y); int nDays = CBCGPCalendar::GetMaxMonthDay (m, y); dt = COleDateTime (y, m, nDays < d ? nDays : d, 0, 0, 0); if (dt < GetDateStart ()) { y++; d = GetPossibleDay (y); nDays = CBCGPCalendar::GetMaxMonthDay (m, y); dt = COleDateTime (y, m, nDays < d ? nDays : d, 0, 0, 0); } if (dt != GetDateStart ()) { SetDateStart (dt); }}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:27,
示例2: ASSERTDWORD COXDateTimeCtrl::GetRange(COleDateTime* pMinTime, COleDateTime* pMaxTime) const{#if _MFC_VER<=0x0421 ASSERT(::IsWindow(m_hWnd)); SYSTEMTIME sysTimes[2]; memset(sysTimes, 0, sizeof(sysTimes)); DWORD dwResult = ::SendMessage(m_hWnd, DTM_GETRANGE, 0, (LPARAM) &sysTimes); if (pMinTime != NULL) { if (dwResult & GDTR_MIN) *pMinTime = COleDateTime(sysTimes[0]); else pMinTime->SetStatus(COleDateTime::null); } if (pMaxTime != NULL) { if (dwResult & GDTR_MAX) *pMaxTime = COleDateTime(sysTimes[1]); else pMaxTime->SetStatus(COleDateTime::null); } return dwResult;#else return CDateTimeCtrl::GetRange(pMinTime,pMaxTime);#endif // _MFC_VER>0x0421}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:31,
示例3: GetSystemLanguagePrimaryIDBOOL CCalendarDateDlg::OnInitDialog() { CDialog::OnInitDialog();/* LANGID dwLanguageID = GetSystemLanguagePrimaryID(); switch( dwLanguageID) { case LANG_SPANISH: CWnd::SetWindowText(_T("Cuadro de selección")); GetDlgItem(IDC_STATIC_PICKDATE)->SetWindowText(_T("Seleccione una fecha:")); GetDlgItem(IDOK)->SetWindowText(_T("Aceptar")); GetDlgItem(IDCANCEL)->SetWindowText(_T("Cancelar")); break; default: CWnd::SetWindowText(_T("Selection dialog")); GetDlgItem(IDC_STATIC_PICKDATE)->SetWindowText(_T("Select a date:")); GetDlgItem(IDOK)->SetWindowText(_T("OK")); GetDlgItem(IDCANCEL)->SetWindowText(_T("Cancel")); break; }*/ // TODO: Add extra initialization here COleDateTime DateMin = COleDateTime(2000,1,1,0,0,0); COleDateTime DateMax = COleDateTime(2035,12,31,0,0,0); m_DateCtrl.SetRange(&DateMin, &DateMax); m_DateCtrl.SetFocus(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE}
开发者ID:malpharo,项目名称:AiPI,代码行数:31,
示例4: ASSERTDWORD CDateTimeCtrl::GetRange(COleDateTime* pMinTime, COleDateTime* pMaxTime) const{ ASSERT(::IsWindow(m_hWnd)); SYSTEMTIME sysTimes[2]; memset(sysTimes, 0, sizeof(sysTimes)); //IA64: Assume retval of DTM_GETRANGE is still 32-bit DWORD dwResult = DWORD(::SendMessage(m_hWnd, DTM_GETRANGE, 0, (LPARAM) sysTimes)); if (pMinTime != NULL) { if (dwResult & GDTR_MIN) *pMinTime = COleDateTime(sysTimes[0]); else pMinTime->SetStatus(COleDateTime::null); } if (pMaxTime != NULL) { if (dwResult & GDTR_MAX) *pMaxTime = COleDateTime(sysTimes[1]); else pMaxTime->SetStatus(COleDateTime::null); } return dwResult;}
开发者ID:pixelspark,项目名称:corespark,代码行数:28,
示例5: ASSERT_VALIDvoid CBCGPPlannerViewWorkWeek::OnActivate(CBCGPPlannerManagerCtrl* pPlanner, const CBCGPPlannerView* pOldView){ ASSERT_VALID(pPlanner); if (pOldView != NULL) { m_Date = pOldView->GetDate (); } m_DateStart = CalculateDateStart ( COleDateTime(m_Date.GetYear (), m_Date.GetMonth (), m_Date.GetDay (), 0, 0, 0)); m_DateEnd = m_DateStart + COleDateTimeSpan (pPlanner->GetWorkWeekInterval () - 1, 23, 59, 59); COleDateTime sel1 (m_Date); COleDateTime sel2 (m_Date); if (pOldView != NULL) { sel1 = pOldView->GetSelectionStart (); sel2 = pOldView->GetSelectionEnd (); } const int nMinuts = CBCGPPlannerView::GetTimeDeltaInMinuts (pPlanner->GetTimeDelta ()); sel1 = COleDateTime (m_DateStart.GetYear (), m_DateStart.GetMonth (), m_DateStart.GetDay (), pPlanner->GetFirstSelectionHour (), (int)(pPlanner->GetFirstSelectionMinute () / nMinuts) * nMinuts, 0); sel2 = sel1 + COleDateTimeSpan (0, 0, nMinuts - 1, 59); //SetSelection (sel1, sel2, FALSE); CBCGPPlannerView::OnActivate (pPlanner, NULL); SetSelection (sel1, sel2);}
开发者ID:iclosure,项目名称:jframework,代码行数:34,
示例6: COleDateTimeCBCGPDateTimeCtrl::CBCGPDateTimeCtrl(){ m_checkButton = TRUE; m_dropCalendar = TRUE; m_showDate = TRUE; m_showTime = TRUE; m_spinButton = TRUE; m_type2DigitsInYear = TRUE; m_maxYear2Digits = 2090; m_bCheckBoxIsAvailable = FALSE; m_iPartNum = 0; m_iPartsNumber = 0; m_bIsChecked = TRUE; m_Date = COleDateTime::GetCurrentTime (); m_iPrevDigit = -1; m_rectText.SetRectEmpty (); m_bShowSelection = FALSE; m_bDropButtonIsPressed = FALSE; m_pPopup = NULL; m_bDropButtonIsPressed = FALSE; m_bMouseOnDropButton = FALSE; for (int i = 0; i < MAX_PARTS; i ++) { m_arPartRects [i].SetRectEmpty (); } m_rectText.SetRectEmpty (); m_bAutoResize = TRUE; m_iControlWidth = 0; m_iControlHeight = 0; m_iYearPos = 0; m_monthFormat = 0; m_MinDate = COleDateTime (iFirstAllowedYear, 1, 1, 0, 0, 0); m_MaxDate = COleDateTime (iLastAllowedYear, 12, 31, 23, 59, 59); m_weekStart = 1; m_b24HoursByLocale = TRUE; m_hFont = NULL; m_bIsInitialized = FALSE; m_bDrawDateTimeOnly = FALSE; m_colorText = (COLORREF)-1; m_colorBackground = (COLORREF)-1;}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:56,
示例7: CDialogExCDlgStock::CDlgStock(CWnd* pParent /*=NULL*/) : CDialogEx(IDD_DIALOG1, pParent){ m_strMarket = _T("SZ"); m_strLable = _T("000002"); m_Cycle = STKCYCLE::DAY; m_bCumDividendPrice = TRUE; m_Time.start = COleDateTime(2004, 5, 19, 0, 0, 0); m_Time.end = COleDateTime(2004, 5, 31, 23, 59, 59);}
开发者ID:houguozhi,项目名称:FortuneIt,代码行数:10,
示例8: switchCOleDateTime CDBField::AsDate() const{ COleDateTime date; if( IsNull() ) { date.SetStatus( COleDateTime::null ); return date; } switch( m_dwType ) { case DBVT_NULL: date.SetStatus( COleDateTime::null ); return date; case DBVT_BOOL: date.SetStatus( COleDateTime::invalid ); return date; case DBVT_UCHAR: date.SetStatus( COleDateTime::invalid ); return date; case DBVT_SHORT: return COleDateTime( (time_t)m_iVal ); case DBVT_LONG: return COleDateTime( (time_t)m_lVal ); case DBVT_SINGLE: return COleDateTime( (time_t)m_fltVal ); case DBVT_DOUBLE: return COleDateTime( (time_t)m_dblVal ); case DBVT_DATE: ASSERT( m_pdate != NULL ); return COleDateTime( m_pdate->year, m_pdate->month, m_pdate->day, m_pdate->hour, m_pdate->minute, m_pdate->second ); case DBVT_STRING: ASSERT( m_pstring != NULL ); date.ParseDateTime( *m_pstring ); return date; case DBVT_BINARY: // Cannot conver long binary to date ASSERT( FALSE ); break; } // Undefined data type ASSERT( FALSE ); date.SetStatus( COleDateTime::invalid ); return date;}
开发者ID:open2cerp,项目名称:Open2C-ERP,代码行数:53,
示例9: Time2AdjustedDate// /////////////////////////////////////////////////////////////////////////////COleDateTime Time2AdjustedDate( const CString& sTime, const COleDateTime& startDate ){ int hr,min; String2HourMin(sTime, hr, min); // If the given time is before the startDate's time, then the target date is one day further // if ((hr < startDate.GetHour()) || ((hr == startDate.GetHour()) && (min < startDate.GetMinute()))) { COleDateTime dt = startDate + COleDateTimeSpan(1,0,0,0); return COleDateTime(dt.GetYear(), dt.GetMonth(), dt.GetDay(), hr, min, 0); } return COleDateTime(startDate.GetYear(), startDate.GetMonth(), startDate.GetDay(), hr, min, 0);}
开发者ID:lbrucher,项目名称:timelis,代码行数:17,
示例10: ASSERT//*****************************************************************************************void CBCGPDateTimeCtrl::ChangeMonth (UINT uiMonthLetter){ ASSERT (m_monthFormat == 0 || m_monthFormat == 1); CBCGPDefaultLocale dl; int iDay = m_Date.GetDay (); int iMonth = m_Date.GetMonth (); int iYear = m_Date.GetYear (); int iHour = m_Date.GetHour (); int iMin = m_Date.GetMinute (); BOOL bLastDayInMonth = (iDay == GetDaysInMonth (iMonth, iYear)); BOOL bFound = FALSE; for (int i = iMonth + 1; i != iMonth; i ++) { if (i > 12) { i = 1; } if (i == iMonth) { break; } //-------------------------------------------------- // Compare manth 'i' first char with the typed char: //-------------------------------------------------- CString strMonth = COleDateTime (iYear, i, 1, 0, 0, 0). Format (m_monthFormat == 0 ? _T ("%b") : _T ("%B")); if (strMonth.GetLength () > 1 && strMonth.GetAt (0) == (char) uiMonthLetter) { iMonth = i; bFound = TRUE; break; } } if (bFound) { if (bLastDayInMonth || iDay > GetDaysInMonth (iMonth, iYear)) { iDay = GetDaysInMonth (iMonth, iYear); } COleDateTime date (iYear, iMonth, iDay, iHour, iMin, 0); if (IsDateValid (date)) { m_Date = date; RedrawWindow (m_rectText); OnDateChanged (); } }}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:61,
示例11: COleDateTimevoid CWizKbSync::onAttachmentsGetInfo(const std::deque<WIZDOCUMENTATTACHMENTDATAEX>& arrayRet){ size_t count = arrayRet.size(); // new attachment if (count == 0) { WIZDOCUMENTATTACHMENTDATA data; data.strGUID = m_currentUploadAttachment.strGUID; data.strDocumentGUID = m_currentUploadAttachment.strDocumentGUID; data.strName = m_currentUploadAttachment.strName; data.tInfoModified = COleDateTime(1900, 1, 1, 0, 0, 0); data.tDataModified = data.tInfoModified; data.strInfoMD5 = "-1"; data.strDataMD5 = "-1"; onQueryAttachmentInfo(data); // server return exist } else if (count == 1) { onQueryAttachmentInfo(arrayRet[0]); // fatal error } else { Q_EMIT processErrorLog("Can not query document info"); onXmlRpcError(SyncMethod_GetDocumentsInfo, errorXmlRpcFault, -1, "Fault error: Invalid document info"); }}
开发者ID:Mybrc91,项目名称:WizQTClient,代码行数:27,
示例12: COleDateTime// NOTE: Windows SCM more tolerant of slow starting processes than terminating processes.void MtcOpcAdapter::start(){ static char name[] = "MtcOpcAdapter::start"; _bRunning=true; if(_bResetAtMidnight) { COleDateTime now = COleDateTime::GetCurrentTime(); COleDateTime date2 = COleDateTime(now.GetYear(), now.GetMonth(), now.GetDay(), 0, 0, 0) + COleDateTimeSpan(1, 0, 0, 1); //COleDateTime date2 = now + COleDateTimeSpan(0, 0, 2, 0); // testing reset time - 2 minutes COleDateTimeSpan tilmidnight = date2-now; _resetthread.Initialize(); _resetthread.AddTimer( (long) tilmidnight.GetTotalSeconds() * 1000, &_ResetThread, (DWORD_PTR) this, &_ResetThread._hTimer // stored newly created timer handle ) ; GLogger << INFO << "Adapter will Reset At Midnight " << date2.Format() << std::endl; } if(_bOPCEnabled) { _workerthread.Initialize(); ::SetEvent (_StartThread._hEvent); // start OPC thread _workerthread.AddHandle(_StartThread._hEvent, &_StartThread,(DWORD_PTR) this); } // This goes last... never returns startServer();}
开发者ID:CubeSpawn-Research,项目名称:MTConnectToolbox,代码行数:33,
示例13: ASSERT_VALIDvoid CBCGPPlannerViewMonth::OnActivate(CBCGPPlannerManagerCtrl* pPlanner, const CBCGPPlannerView* pOldView){ ASSERT_VALID(pPlanner); if (pOldView != NULL) { m_Date = pOldView->GetDate (); } m_nDuration = 35; m_DateStart = CalculateDateStart ( COleDateTime(m_Date.GetYear (), m_Date.GetMonth (), m_Date.GetDay (), 0, 0, 0)); m_DateEnd = m_DateStart + COleDateTimeSpan (m_nDuration - 1, 23, 59, 59); if (m_Date > m_DateEnd || m_Date < m_DateStart) { m_Date = m_DateStart; } COleDateTime sel1 (m_Date); COleDateTime sel2 (m_Date); if (pOldView != NULL) { sel1 = pOldView->GetSelectionStart (); sel2 = pOldView->GetSelectionEnd (); } SetSelection (sel1, sel2, FALSE); CBCGPPlannerView::OnActivate (pPlanner, NULL);}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:32,
示例14: dlg// //////////////////////////////////////////////////////////////////////////////void CDlgEvents::OnModify() { int n = m_Events.GetCurSel(); if (n == -1) return; long id = (long) m_Events.GetItemData(n); CRecEvent rec; if (! rec.FindByID(id) ) return; CDlgEditEvent dlg(this); SYSTEMTIME st; rec.m_trigger.GetAsSystemTime(st); dlg.m_Date = CTime(st); dlg.m_Time = CTime(st); dlg.m_Text = rec.m_text; if ( dlg.DoModal() != IDOK ) return; rec.FindByID(id); rec.Edit(); rec.m_time = COleDateTime( dlg.m_Date.GetYear(), dlg.m_Date.GetMonth(), dlg.m_Date.GetDay(), dlg.m_Time.GetHour(), dlg.m_Time.GetMinute(), dlg.m_Time.GetSecond() ); rec.m_trigger = rec.m_time; rec.m_text = dlg.m_Text; rec.m_fired = FALSE; rec.Update(); refreshList();}
开发者ID:lbrucher,项目名称:timelis,代码行数:36,
示例15: SetTimeOfDate// ///////////////////////////////////////////////////////////////////////////// Build a new date object by copying the given date object and replacing// its time by the given one//COleDateTime SetTimeOfDate( const COleDateTime& date, const CString& sTime ){ int hr,min; String2HourMin(sTime, hr, min); return COleDateTime(date.GetYear(), date.GetMonth(), date.GetDay(), hr, min, 0);}
开发者ID:lbrucher,项目名称:timelis,代码行数:11,
示例16: COleDateTimeCOleDateTime COXCalendarEdit::GetDateFromString(LPCTSTR lpszDateString){ CString strDate = lpszDateString; // First get the year // 1. Find where the year starts and where it ends int iYearStartIdx = m_strDateFormat.Find('Y'); int iYearEndIdx = m_strDateFormat.ReverseFind('Y'); CString strYearOnly = strDate.Mid(iYearStartIdx, iYearEndIdx - iYearStartIdx + 1); int iYear = ::_ttoi(strYearOnly); // 2. Find where the month starts and where it ends int iMonthStartIdx = m_strDateFormat.Find('M'); int iMonthEndIdx = m_strDateFormat.ReverseFind('M'); CString strMonthOnly = strDate.Mid(iMonthStartIdx, iMonthEndIdx - iMonthStartIdx + 1); int iMonth = ::_ttoi(strMonthOnly); // 3. Find where the day starts and where it ends int iDayStartIdx = m_strDateFormat.Find('D'); int iDayEndIdx = m_strDateFormat.ReverseFind('D'); CString strDayOnly = strDate.Mid(iDayStartIdx, iDayEndIdx - iDayStartIdx + 1); int iDay = ::_ttoi(strDayOnly); return COleDateTime(iYear, iMonth, iDay, 0, 0, 0);}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:26,
示例17: ASSERT_VALID//****************************************************************************************void CBCGPDateTimeCtrl::BuidWidestDate (CDC* pDC){ ASSERT_VALID (pDC); CBCGPDefaultLocale dl; //----------------------- // Find the widest month: //----------------------- int iMaxMonth = 1; if (m_monthFormat == 2) // Numeric { iMaxMonth = 9; } else { int iMaxMonthWidth = 0; for (int iMonth = 1; iMonth <= 12; iMonth ++) { COleDateTime date (1998, iMonth, 1, 0, 0, 0); CString strMonth = date.Format (m_monthFormat == 0 ? _T ("%b") : _T("%B")); int iMonthWidth = pDC->GetTextExtent (strMonth).cx; if (iMonthWidth > iMaxMonthWidth) { iMaxMonthWidth = iMonthWidth; iMaxMonth = iMonth; } } } m_WidestDate = COleDateTime (2000, iMaxMonth, 20, 0, 0, 0);}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:35,
示例18: CSysImageListint CRemoteFileDialog::AddFileItem(LPCTSTR szFileName, int nType, UINT nUniqueID, DWORD dwFileSize, const FILETIME* pLastMod, int nImage){ if (nImage == -1) { nImage = CSysImageList().GetFileImageIndex(szFileName); } int nItem = m_lcFiles.InsertItem(LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM, 0, szFileName, 0, 0, nImage, nUniqueID); // add to map FILEITEM fi; fi.sFilename = szFileName; fi.nType = nType; fi.dwSize = dwFileSize; if (pLastMod) { FILETIME ftLocal; FileTimeToLocalFileTime(pLastMod, &ftLocal); fi.dLastMod = COleDateTime(ftLocal); } m_mapItems[nUniqueID] = fi; // add size and date item if a file if (nType == RFDT_FILE && m_bInitReport) { m_lcFiles.SetItemText(nItem, 1, FormatSize(fi.dwSize)); m_lcFiles.SetItemText(nItem, 2, FormatDate(fi.dLastMod)); } return nItem;}
开发者ID:noindom99,项目名称:repositorium,代码行数:35,
示例19: COleDateTimevoid CXTPDatePickerItemMonth::PopulateDays(){ if (m_dtMonth.GetYear() <= 100 && m_dtMonth.GetMonth() <= 2) m_dtMonth = COleDateTime(100,2,1,0,0,0); if (m_dtMonth.GetStatus() != COleDateTime::valid) { ASSERT(FALSE); m_dtMonth = CXTPCalendarUtils::ResetTime(COleDateTime::GetCurrentTime()); } //if (m_dtMonth < COleDateTime(1601,4,1,0,0,0)) // m_dtMonth = COleDateTime(1601,4,1,0,0,0); // init days from 1st to last COleDateTime dtDay(m_dtMonth.GetYear(), m_dtMonth.GetMonth(), 1, 0, 0, 0); COleDateTimeSpan spDay(1, 0, 0, 0); // adjust first day of the week int nOleFirstDayOfWeek = m_pControl->GetFirstDayOfWeek(); int iDayOfWeek = dtDay.GetDayOfWeek(); if (iDayOfWeek != -1) { while (dtDay.GetDayOfWeek() != nOleFirstDayOfWeek && dtDay.GetDayOfWeek() != -1) { dtDay -= spDay; } } else { COleDateTime dtFutureDay(dtDay); dtFutureDay.SetDate(dtFutureDay.GetYear() + 2000, dtFutureDay.GetMonth(), dtFutureDay.GetDay()); iDayOfWeek = dtFutureDay.GetDayOfWeek(); while (dtFutureDay.GetDayOfWeek() != nOleFirstDayOfWeek && dtFutureDay.GetDayOfWeek() != -1) { dtFutureDay -= spDay; dtDay -= spDay; } } //while (dtDay.GetDayOfWeek() != nOleFirstDayOfWeek && dtDay.GetDayOfWeek() != -1) //{ // dtDay -= spDay; //} // populate all grid days for (int nWeek = 0; nWeek < XTP_MAX_WEEKS; nWeek++) { for (int nDay = 0; nDay < XTP_WEEK_DAYS; nDay++) { // create and add new day item CXTPDatePickerItemDay* pDay = new CXTPDatePickerItemDay(m_pControl, this, dtDay); m_arrDays.Add(pDay); // move next day dtDay += spDay; } }}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:59,
示例20: whilevoid CCalendarDlg2::SetTextForDay(SYSTEMTIME* sysTime){ static BOOL bFirst=1; static CString sDovesok; static COleDateTime dtCurrent; if(!bFirst && dtCurrent.GetStatus()!=COleDateTime::invalid) { CString sThisDayNKey=Format(sKey,dtCurrent.GetDay(),dtCurrent.GetMonth(),dtCurrent.GetYear()); CString sCurDay; m_eText.GetWindowText(sCurDay); sCurDay.TrimLeft(); sCurDay.TrimRight(); if(sCurDay!="") { sCurDay.Replace("/r/n","/n"); if(sDovesok!="") { sCurDay+=Format("[?CDATA{%s}?DATAC:)]",sDovesok); } if(!bINewLine) { sCurDay.Replace("/n","<br>"); } CString sContent=CString("/n")+sCurDay+"/n"; while(sContent!="") { CString sLine=sContent.SpanExcluding("/n"); if(sLine!="") { aItems.Add(sThisDayNKey+sLine); if(sContent.GetLength()>sLine.GetLength()) { sContent=sContent.Mid(sLine.GetLength()+1); } else { sContent=""; } } sContent.TrimLeft(); } } sDovesok=""; } bFirst=0; if(sysTime) { COleDateTime dtTime=COleDateTime(sysTime->wYear,sysTime->wMonth,sysTime->wDay,0,0,0); char szTmp[256]= {0}; GetDateFormat(LOCALE_USER_DEFAULT,DATE_SHORTDATE,sysTime,0,szTmp,sizeof(szTmp)); GetDlgItem(IDC_STATIC3)->SetWindowText(Format("%s: %s",_l("Current date"),szTmp)); CString sThisDayNKey=Format(sKey,dtTime.GetDay(),dtTime.GetMonth(),dtTime.GetYear()); dtCurrent=dtTime; CString sDayNote; for(int i=aItems.GetSize()-1; i>=0; i--) { if(aItems[i].Find(sThisDayNKey)==0) { if(sDayNote!="") { sDayNote+="/r/n"; } sDayNote+=aItems[i].Mid(sThisDayNKey.GetLength()); aItems.RemoveAt(i); } } sDovesok=CDataXMLSaver::GetInstringPart("[?CDATA{","}?DATAC:)]",sDayNote); sDayNote.Replace(Format("[?CDATA{%s}?DATAC:)]",sDovesok),""); sDayNote.Replace("<br>","/r/n"); m_eText.SetWindowText(sDayNote); }}
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:59,
示例21: GetFirstWeekDay2void CBCGPPlannerPrintMonth::CalculateDates (const COleDateTime& date){ BOOL bNeedUpdate = TRUE; if (m_DateStart != COleDateTime () && m_DateEnd != COleDateTime ()) { bNeedUpdate = ((m_DateEnd - m_DateStart).GetTotalDays () + 1) < 14; } if (bNeedUpdate) { m_DateStart = GetFirstWeekDay2 (COleDateTime (date.GetYear (), date.GetMonth (), 1, 0, 0, 0), CBCGPPlannerManagerCtrl::GetFirstDayOfWeek () + 1); m_DateEnd = m_DateStart + COleDateTimeSpan (34, 23, 59, 59); }}
开发者ID:iclosure,项目名称:jframework,代码行数:17,
示例22: COleDateTime//日期转化函数(需要delete)WCHAR* WindData::DateToString(DATE date, LPCWSTR strFormat){ wstring str = COleDateTime(date).Format(strFormat); int length = str.length() + 1; WCHAR* timeBuffer = new WCHAR[length]; swprintf(timeBuffer, length, L"%s", str.c_str()); return timeBuffer;}
开发者ID:Pluzhou,项目名称:Official,代码行数:10,
示例23: s1void CBCGPPlannerViewMonth::SetSelection (const COleDateTime& sel1, const COleDateTime& sel2, BOOL bRedraw){ COleDateTime s1 (sel1); COleDateTime s2 (sel2); if (s1 < s2 || IsOneDay (s1, s2)) { s1 = COleDateTime (s1.GetYear (), s1.GetMonth (), s1.GetDay (), 0, 0, 0); s2 = COleDateTime (s2.GetYear (), s2.GetMonth (), s2.GetDay (), 23, 59, 59); } else { s2 = COleDateTime (s2.GetYear (), s2.GetMonth (), s2.GetDay (), 0, 0, 0); s1 = COleDateTime (s1.GetYear (), s1.GetMonth (), s1.GetDay (), 23, 59, 59); } CBCGPPlannerView::SetSelection (s1, s2, bRedraw);}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:18,
示例24: data /// <summary>Opens a document template.</summary> /// <param name="docPath">document path.</param> /// <param name="t">template.</param> /// <returns></returns> BOOL ScriptDocument::OnOpenTemplate(Path docPath, const TemplateFile& t) { WorkerData data(Operation::LoadSaveDocument); try { // Feedback Console << Cons::UserAction << "Creating script: " << docPath << " from template: " << Path(t.SubPath) << ENDL; data.SendFeedback(ProgressType::Operation, 0, VString(L"Creating %s '%s'", t.Name.c_str(), docPath.c_str())); // Read/Parse template script AppPath path(t.SubPath); Script = ScriptFileReader(XFileInfo(path).OpenRead()).ReadFile(path, false); // Set properties Script.Name = docPath.RemoveExtension().FileName; Script.Game = PrefsLib.GameDataVersion; Script.Version = 1; Script.Description = L"no description"; // Populate template LineArray lines; wstring date = COleDateTime(time(nullptr)).Format(L"%d/%m/%Y"); for (auto& cmd : Script.Commands.Input) { cmd.Text = cmd.Text.ReplaceAll(L"$NAME$", Script.Name); cmd.Text = cmd.Text.ReplaceAll(L"$DATE$", date); cmd.Text = cmd.Text.ReplaceAll(L"$AUTHOR$", L""); lines.push_back(cmd.Text); } // Create temp scriptFile ScriptFile tmp(Script); tmp.FullPath = docPath; // Compile changes into temporary script ScriptParser parser(tmp, lines, Script.Game); parser.Compile(); // Write to disc ScriptFileWriter w(XFileInfo(docPath).OpenWrite()); w.Write(tmp); w.Close(); // Feedback data.SendFeedback(Cons::Success, ProgressType::Succcess, 0, L"Script created successfully"); return TRUE; } catch (ExceptionBase& e) { // Feedback/Display error data.SendFeedback(Cons::Error, ProgressType::Failure, 0, VString(L"Failed to create %s '%s'", t.Name.c_str(), docPath.c_str())); theApp.ShowError(HERE, e, VString(L"Failed to create %s '%s'", t.Name.c_str(), docPath.c_str())); return FALSE; } }
开发者ID:CyberSys,项目名称:X-Studio-2,代码行数:60,
示例25: GetDateTimestatic COleDateTime GetDateTime(std::string s){ // parse 2012-02-03T17:31:51.0968Z int Year, Month, Day, Hour, Minute, Second, Millisecond; if(sscanf(s.c_str(), "%d-%d-%dT%d:%d:%d.%d", &Year, &Month, &Day, &Hour, &Minute,&Second, &Millisecond)==7){} //12/2/2009 2:42:25 PM else if(sscanf(s.c_str(), "%d/%d/%4d%d:%d:%d", &Month, &Day, &Year, &Hour, &Minute,&Second)==6){} else throw std::exception("Unrecognized date-time format/n"); return COleDateTime( Year, Month, Day, Hour, Minute, Second ); }
开发者ID:amanrenishaw,项目名称:MTConnectGadgets,代码行数:10,
注:本文中的COleDateTime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ COleVariant函数代码示例 C++ COUNT_OF函数代码示例 |