• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetDate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetDate函数的典型用法代码示例。如果您正苦于以下问题:C++ GetDate函数的具体用法?C++ GetDate怎么用?C++ GetDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetDate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetText

	void TaskDlg::UpdateData()
	{
		GetText(title, IDC_CREATE_TASK_EDIT_TITLE);
		GetText(desc, IDC_CREATE_TASK_EDIT_DESCRIPTION);
		GetText(assignee, IDC_CREATE_TASK_ASSIGNEE_COMBO);
		GetText(group, IDC_CREATE_TASK_GROUP_COMBO);

		start = GetDate(IDC_CREATE_TASK_DATETIMEPICKER_START, 0, 0);
		due = GetDate(IDC_CREATE_TASK_DATETIMEPICKER_DUE, 23, 59);

		TreeItem *pItem = m_pTaskCombo->GetSelectedItem();
		if(pItem)
		{
			TaskItem *pTaskItem = static_cast<TaskItem *>(pItem);
			parentId = pTaskItem->m_pTask->GetId();
			parentTask = pTaskItem->m_pTask;
		}

		HWND hwndTemp = GetDlgItem(m_hwnd, IDC_CREATE_TASK_COMBO_PRIORITY);
		LRESULT comboItem = ::SendMessage(hwndTemp, CB_GETCURSEL, 0, 0);
		priority = comboItem != CB_ERR? comboItem + 1: 3;

		estimate = 0;//EMPTY_DURATION;
		if(m_pEstDuration->IsChecked())
		{
			estimate = m_pEstDuration->GetDuration();
		}


	}
开发者ID:jaylauffer,项目名称:loadngo,代码行数:30,代码来源:TaskDlg.cpp


示例2: CheckSymbolsAndWriteOut

bool CheckSymbolsAndWriteOut(const char *define_type, const char *define_value, char *sOut)
{
	if( !strcmp(define_type, STRING_DATE) )
	{
		char sNewDate[50];
		if( !GetDate(sNewDate, NULL, true) )
			return false;
		
		str_ReplaceOnce(strstr(sOut, STRING_DATE), define_value, sNewDate);
	}
	if( !strcmp(define_type, STRING_TIME) )
	{
		char sNewTime[50];
		if( !GetDate(NULL, sNewTime, true) )
			return false;
		
		str_ReplaceOnce(strstr(sOut, STRING_TIME), define_value, sNewTime);
	}
	if( !strcmp(define_type, STRING_BUILD) )
	{
		char sNewBuild[50];
		if(!bIncrementVersion)
			return true;
		sprintf( sNewBuild, "%d", atoi(define_value)+1 );
		str_ReplaceOnce(strstr(sOut, STRING_BUILD), define_value, sNewBuild);
	}
	return true;
}
开发者ID:githubbar,项目名称:NewVision,代码行数:28,代码来源:makeversion.c


示例3: GetDate

size_t mitk::DiffusionCollectionWriter::GetIndexForinXMonths(mitk::DiffusionCollectionReader::FileListType fileList,float months, size_t curIndex,std::vector<std::string> filter)
{
  std::string strDate0 = GetDate(fileList.at(0).at(curIndex),filter.at(0),true);

  int year0 =std::atoi(strDate0.substr(0,4).c_str());
  int month0 =std::atoi(strDate0.substr(5,2).c_str());
  int day0 = std::atoi(strDate0.substr(8,2).c_str());

  size_t bestIndex = 0;
  int bestFit = 1e5;

  for (size_t i=curIndex+1; i < fileList.at(0).size(); ++i)
  {
    std::string strDate = GetDate(fileList.at(0).at(i),filter.at(0),true);
    int year =std::atoi(strDate.substr(0,4).c_str());
    int month =std::atoi(strDate.substr(5,2).c_str());
    int day = std::atoi(strDate.substr(8,2).c_str());

    int fit = std::fabs((months * 30 ) - (((year-year0)*360) +((month-month0)*30) + (day-day0))); // days difference from x months
    if (fit < bestFit)
    {
      bestFit = fit;
      bestIndex = i;
    }
  }
  return bestIndex;
}
开发者ID:Cdebus,项目名称:MITK,代码行数:27,代码来源:mitkDiffusionCollectionWriter.cpp


示例4: GetSequence

void CertDecoder::GetValidity()
{
    if (source_.GetError().What()) return;

    GetSequence();
    GetDate(BEFORE);
    GetDate(AFTER);
}
开发者ID:zhongliangkang,项目名称:mysql-5.6.6-labs-april-2012-sky,代码行数:8,代码来源:asn.cpp


示例5: FileContentInit

/*
*********************************************************************************************************
*                                        Title in the file
*********************************************************************************************************
*/
void FileContentInit(void) {
	FILE* fp_source,*fp_receive;
	char filename[25];
	GetDate(filename);
	strcat(filename,"Sd.dat");
	fp_source = fopen(filename,"w");
	fprintf(fp_source,"%11s%5s%5s%5s%5s%5s%5s%5s%5s%5s%6s\n%6s","Source:(1)","(2)","(3)","(4)","(5)","(6)","(7)","(8)","(9)","(10)","(AVG)"," ");
	fclose(fp_source);
	GetDate(filename);
	strcat(filename,"Rv.dat");
	fp_receive = fopen(filename,"w");
	fprintf(fp_receive, "%11s%5s%5s%5s%5s%5s%5s%5s%5s%5s%6s\n%6s","Receive:(1)","(2)","(3)","(4)","(5)","(6)","(7)","(8)","(9)","(10)","(AVG)"," ");
	fclose(fp_receive);
}
开发者ID:loganwhite,项目名称:uCOSIIExp,代码行数:19,代码来源:TEST.C


示例6: GetDate

void CTraderApi::OnRtnForQuote(CUstpFtdcReqForQuoteField *pReqForQuote)
{
	QuoteRequestField* pField = (QuoteRequestField*)m_msgQueue->new_block(sizeof(QuoteRequestField));

	pField->TradingDay = GetDate(pReqForQuote->TradingDay);
	pField->QuoteTime = GetDate(pReqForQuote->ReqForQuoteTime);
	strcpy(pField->Symbol, pReqForQuote->InstrumentID);
	strcpy(pField->InstrumentID, pReqForQuote->InstrumentID);
	strcpy(pField->ExchangeID, pReqForQuote->ExchangeID);
	sprintf(pField->Symbol, "%s.%s", pField->InstrumentID, pField->ExchangeID);
	strcpy(pField->QuoteID, pReqForQuote->ReqForQuoteID);

	m_msgQueue->Input_NoCopy(ResponeType::OnRtnQuoteRequest, m_msgQueue, m_pClass, 0, 0,
		pField, sizeof(QuoteRequestField), nullptr, 0, nullptr, 0);
}
开发者ID:ZHPHAN,项目名称:QuantBox_XAPI,代码行数:15,代码来源:TraderApi.cpp


示例7: SetRTCTime

/*********************************
**函数名:SetRTCTime
**功能:设置时间,除了把Real_Time的值改变外,还要把时分秒转换为RTC计数值,年月日存到后备寄存器上
**注意事项:函数内会自动根据年月日计算星期,并且返回到*time上
**********************************/
void SetRTCTime(T_STRUCT* time)
{
	u32 count;
	RTC_ITConfig(RTC_IT_SEC, DISABLE);	//关闭秒中断

	RTC_WaitForLastTask();
	//付时间值到Real_Time上
	Real_Time.year=time->year;
	Real_Time.month=time->month;
	Real_Time.day=time->day;
	Real_Time.hour=time->hour;
	Real_Time.minute=time->minute;
	Real_Time.sec=time->sec;
	//计算星期
	time->date=Real_Time.date=GetDate(time);

	//把新的年月日存到掉电寄存器上

	BKP_WriteBackupRegister(BKP_TIME_DATE,Real_Time.date);
//	RTC_WaitForLastTask();
	BKP_WriteBackupRegister(BKP_TIME_DAY,Real_Time.day);
//	RTC_WaitForLastTask();
	BKP_WriteBackupRegister(BKP_TIME_MONTH,Real_Time.month);
//	RTC_WaitForLastTask();
	BKP_WriteBackupRegister(BKP_TIME_YEAR,Real_Time.year);
//	RTC_WaitForLastTask();

	//计算新的RTC count值
	count=Real_Time.hour*3600+Real_Time.minute*60+Real_Time.sec;
	RTC_WaitForLastTask();
	RTC_SetCounter(count);
	RTC_WaitForLastTask();
	RTC_ITConfig(RTC_IT_SEC, ENABLE); //打开秒中断
}
开发者ID:jiangtaojiang,项目名称:bloodpressure,代码行数:39,代码来源:RTC.c


示例8: Show4Months

BOOL WINAPI Show4Months(CCallbacks* pCallback, const char* szFile, HWND pParent)
{
	char szOutKey[256]={0};
	char szOutTitle[256]={0};
	BOOL bRes=GetDate(pCallback, szOutKey, sizeof(szOutKey), szOutTitle, sizeof(szOutTitle));
	return bRes;
}
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:7,代码来源:Pickers.cpp


示例9: return

//============================================================================
//		NDate::GetDayOfWeek : Get the day of the week.
//----------------------------------------------------------------------------
NIndex NDate::GetDayOfWeek(const NString &timeZone) const
{


    // Get the day of the week
    return(NTargetTime::GetDayOfWeek(GetDate(timeZone)));
}
开发者ID:refnum,项目名称:nano,代码行数:10,代码来源:NDate.cpp


示例10: GetDate

int32 FDateTime::GetDay( ) const
{
	int32 Year, Month, Day;
	GetDate(Year, Month, Day);

	return Day;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:7,代码来源:DateTime.cpp


示例11: switch

void CalendarControl::MessageReceived(BMessage *msg)
{
 switch(msg->what)
 {
  case CalendarControlButtonPressedMessage:
  {
   if(IsEnabled())
   {
    MakeFocus(true);
    int day, month, year;
    int first_year, last_year;
    GetDate(&day, &month, &year);
    GetYearRange(&first_year, &last_year);
    new MonthWindow(ConvertToScreen(BPoint(Bounds().left+1,Bounds().bottom+1)),
                                    new BMessenger(this),
                                    day, month, year, first_year, last_year);
   }
   break;
  }
  case 'MVME': // message has come from window with calendar
  {
   int32 day, month, year;
   msg->FindInt32("day",&day);
   msg->FindInt32("month",&month);
   msg->FindInt32("year",&year);
   SetDate((int)day, (int)month, (int)year);
   break;
  }
  default:
   BControl::MessageReceived(msg);
 }
}
开发者ID:BackupTheBerlios,项目名称:projectconcepto-svn,代码行数:32,代码来源:CalendarControl.cpp


示例12: StatePrintRace

void StatePrintRace( ISState* pThis, int pTrack )
{
   int lCounter;

   if( pThis->mRaceTrackIndex[pTrack] != -1 )
   {

      printf( "<table border=2>\n" );

      printf( "<tr><td colspan=5>%s %d Laps</td></tr>\n",
               pThis->mTrack[ pThis->mRaceTrackIndex[ pTrack ] ].mName,
               pThis->mRaceTrackLaps[ pTrack ] );

      printf( "<tr><td>Rank</td><td>Player</td><td>Time</td><td>Date</td><td>Craft</td></tr>\n" );

      for( lCounter = 0; lCounter < IR_MAX_PLAYER_BT; lCounter++ )
      {
         if( pThis->mRaceRecord[pTrack][lCounter].mDuration > 0 )
         {
            printf( "<tr><td>%d</td><td>%s</td><td>%2d:%02d:%02d</td><td>%s</td><td>%s</td></tr>\n",
                    lCounter+1,
                    pThis->mRaceRecord[pTrack][lCounter].mUser,
                    (pThis->mRaceRecord[pTrack][lCounter].mDuration/60000),
                    (pThis->mRaceRecord[pTrack][lCounter].mDuration/1000)%60,
                    (pThis->mRaceRecord[pTrack][lCounter].mDuration/10)%100,                  
                    GetDate(pThis->mRaceRecord[pTrack][lCounter].mDate),
                    CraftModels[pThis->mRaceRecord[pTrack][lCounter].mCraft].mName );
         }
      }
      printf( "</table>" );
   }
}
开发者ID:johnsie,项目名称:IMR,代码行数:32,代码来源:ServerScore2.c


示例13: GetDate

bool wxCalendarCtrlBase::GenerateAllChangeEvents(const wxDateTime& dateOld)
{
    const wxDateTime::Tm tm1 = dateOld.GetTm(),
                         tm2 = GetDate().GetTm();

    bool pageChanged = false;

    GenerateEvent(wxEVT_CALENDAR_SEL_CHANGED);
    if ( tm1.year != tm2.year || tm1.mon != tm2.mon )
    {
        GenerateEvent(wxEVT_CALENDAR_PAGE_CHANGED);

        pageChanged = true;
    }

    // send also one of the deprecated events
    if ( tm1.year != tm2.year )
        GenerateEvent(wxEVT_CALENDAR_YEAR_CHANGED);
    else if ( tm1.mon != tm2.mon )
        GenerateEvent(wxEVT_CALENDAR_MONTH_CHANGED);
    else
        GenerateEvent(wxEVT_CALENDAR_DAY_CHANGED);

    return pageChanged;
}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:25,代码来源:calctrlcmn.cpp


示例14: ErrLog

void ErrLog( char *file, int line, char *fmt, ... )
{
    va_list ap;
    FILE   *fp;
    int    fd;
    char timebuf[20];
    char datebuf[20];
		char log_name[100];

		memset( log_name, 0, sizeof( log_name ) ) ;
		memset( datebuf, 0, sizeof( datebuf ) ) ;
		GetDate( datebuf );
		strcpy( log_name, LOG_FILE_NAME ) ;
		strcat( log_name, "." ) ;
		strcat( log_name, datebuf ) ;

    if ( (fp=fopen( log_name, "a+")) == NULL ) {
        fprintf(stderr, "open %s file error.\n", LOG_FILE_NAME);
        return;
    }
    fd = fileno(fp);
    lockf (fd, F_LOCK, 0l);
    GetTime( timebuf );
    fprintf (fp, "[%s] ", timebuf );
    fprintf (fp, "[%s line %d] :\n", file, line);
    va_start( ap, fmt );
    vfprintf( fp, fmt, ap );
		fprintf(fp, "\n");
    va_end( ap );
    lockf(fd, F_ULOCK, 0l);
    fclose(fp);
    return;
}
开发者ID:mildrock,项目名称:netBankGateWay,代码行数:33,代码来源:flog.c


示例15: GetISBN

/*********************************************************
*函数名:    Print()
*函数功能:  输入单个图书的全部信息
*
*函数参数:  void
*函数返回值:void
*********************************************************/
void Book::Print()
{
    cout <<  GetISBN()  << '\t'  << GetTitle() << '\t';
    cout << GetAuthor() << '\t'  << GetPublisher() << '\t';
    cout << GetDate() << '\t' << GetPrice();
    cout << setw(10) << GetCatalogNum() << setw(11) << GetNumber() << endl;
}
开发者ID:AI-Ying,项目名称:C-plus-plus-BookManage1.0,代码行数:14,代码来源:Book.cpp


示例16: strcpy

void CTraderApi::OnRspQryInstrument(CUstpFtdcRspInstrumentField *pRspInstrument, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
	if (!IsErrorRspInfo(pRspInfo, nRequestID, bIsLast))
	{
		if (pRspInstrument)
		{
			InstrumentField* pField = (InstrumentField*)m_msgQueue->new_block(sizeof(InstrumentField));

			strcpy(pField->InstrumentID, pRspInstrument->InstrumentID);
			strcpy(pField->ExchangeID, pRspInstrument->ExchangeID);

			strcpy(pField->Symbol, pRspInstrument->InstrumentID);
			strncpy(pField->ProductID, pRspInstrument->ProductID, sizeof(InstrumentIDType));

			strcpy(pField->InstrumentName, pRspInstrument->InstrumentName);
			pField->Type = CUstpFtdcRspInstrumentField_2_InstrumentType(pRspInstrument);
			pField->VolumeMultiple = pRspInstrument->VolumeMultiple;
			pField->PriceTick = pRspInstrument->PriceTick;
			pField->ExpireDate = GetDate(pRspInstrument->ExpireDate);
			pField->OptionsType = TUstpFtdcOptionsTypeType_2_PutCall(pRspInstrument->OptionsType);
			pField->StrikePrice = pRspInstrument->StrikePrice == DBL_MAX ? 0 : pRspInstrument->StrikePrice;

			m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InstrumentField), nullptr, 0, nullptr, 0);
		}
		else
		{
			m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0);
		}
	}
}
开发者ID:AlexTaylorTsang,项目名称:QuantBox_XAPI,代码行数:30,代码来源:TraderApi.cpp


示例17: GetDate

void CTraderApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
	RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField));

	if (!IsErrorRspInfo(pRspInfo)
		&&pRspUserLogin)
	{
		pField->TradingDay = GetDate(pRspUserLogin->tradeDate);
		pField->LoginTime = GetTime(pRspUserLogin->lastLoginTime);
		//sprintf(pField->SessionID, "%d:%d", pRspUserLogin->FrontID, pRspUserLogin->SessionID);

		m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, this, ConnectionStatus::Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0);
		m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, this, ConnectionStatus::Done, 0, nullptr, 0, nullptr, 0, nullptr, 0);

		// 记下登录信息,可能会用到
		memcpy(&m_RspUserLogin,pRspUserLogin,sizeof(CThostFtdcRspUserLoginField));
		m_nMaxOrderRef = atol(pRspUserLogin->localOrderNo);
		// 自己发单时ID从1开始,不能从0开始
		m_nMaxOrderRef = m_nMaxOrderRef>1 ? m_nMaxOrderRef:1;
	}
	else
	{
		pField->ErrorID = pRspInfo->ErrorID;
		strncpy(pField->ErrorMsg, pRspInfo->ErrorMsg, sizeof(ErrorMsgType));

		m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, this, ConnectionStatus::Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0);
	}
}
开发者ID:FlyingOE,项目名称:QuantBox_XAPI,代码行数:28,代码来源:TraderApi.cpp


示例18: openSaveFile

void openSaveFile(){

  long int ii=0, jj=0, kk=0;
  char file_name[200]="hvmon-", tt[50]="\0";
/*
    Build file name out of date and time
*/
  sprintf(tt,"%s%c",GetDate(),'\0');
  jj=0;
  jj = strlen(tt);
  ii=0;
  kk=0;
  while (ii < jj) {
    if (isspace(tt[ii]) == 0) tt[kk++] = tt[ii];
    ii++;
  }
  tt[kk]='\0';
  if (jj > 0) strcat(file_name,tt);
  strcat(file_name,".conf\0");
/*
    Open file
*/
 if (( fileSave = fopen (file_name,"a+") ) == NULL){
   printf ("*** File on disk could not be opened \n");
   exit (EXIT_FAILURE);
 }
  printf("hvmon new config file opened: %s\n",file_name);             

  return;
}
开发者ID:ntbrewer,项目名称:DAQ_1,代码行数:30,代码来源:hvmon-read-mmap.c


示例19: GetDate

void wxGtkCalendarCtrl::GTKGenerateEvent(wxEventType type)
{
    // First check if the new date is in the specified range.
    wxDateTime dt = GetDate();
    if ( !IsInValidRange(dt) )
    {
        if ( m_validStart.IsValid() && dt < m_validStart )
            dt = m_validStart;
        else
            dt = m_validEnd;

        SetDate(dt);

        return;
    }

    if ( type == wxEVT_CALENDAR_SEL_CHANGED )
    {
        // Don't generate this event if the new date is the same as the old
        // one.
        if ( m_selectedDate == dt )
            return;

        m_selectedDate = dt;

        GenerateEvent(type);

        // Also send the deprecated event together with the new one.
        GenerateEvent(wxEVT_CALENDAR_DAY_CHANGED);
    }
    else
    {
        GenerateEvent(type);
    }
}
开发者ID:iokto,项目名称:newton-dynamics,代码行数:35,代码来源:calctrl.cpp


示例20: fwrite

void HttpdSocket::OnData(const char *p,size_t l)
{
	if (m_file)
	{
		m_file -> fwrite(p,1,l);
	}
	m_received += l;
	if (m_received >= m_content_length && m_content_length)
	{
		// all done
		if (m_file && !m_form)
		{
			m_form = new HttpdForm(m_file, m_content_type, m_content_length);
			AddResponseHeader("Date", datetime2httpdate(GetDate()) );
			if (GetUri() == "/image")
			{
				Send64(Utility::Logo, "image/png");
			}
			else
			{
				Exec();
			}
			Reset(); // prepare for next request
		}
	}
}
开发者ID:davidivins,项目名称:schoolprojects,代码行数:26,代码来源:HttpdSocket.cpp



注:本文中的GetDate函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetDateFormat函数代码示例发布时间:2022-05-30
下一篇:
C++ GetDatabaseEncoding函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap