当前位置: 首页>>代码示例>>C++>>正文


C++ TDateTime::DateString方法代码示例

本文整理汇总了C++中TDateTime::DateString方法的典型用法代码示例。如果您正苦于以下问题:C++ TDateTime::DateString方法的具体用法?C++ TDateTime::DateString怎么用?C++ TDateTime::DateString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TDateTime的用法示例。


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

示例1:

//---------------------------------------------------------------------------
void __fastcall TForm1::MonthCalendar1Click(TObject *Sender)
{
	TMonthCalendar* tmc = ( TMonthCalendar* ) Sender;
	TDateTime tdt = tmc->Date;
	//changes date of the newly opened window to the selected date
	Form2->Label6->Caption = tdt.DateString();

	ListBox1->Clear();

	Appointment a;
	IOFile io;

	io.openFileInOut();
	io.fileClear();
	io.fileSeekG();
	a = io.fileRead(a);
	bool haveAppointments = false;

	while ( !io.eof() )
	{
		if ( a.getDate().compare( tdt.DateString().t_str() ) == 0 )
		{
			//adds the values in the listbox
			ListBox1->Items->Append( a.values().c_str() );

			haveAppointments = true;

			if ( haveAppointments == true )
			{
				Label4->Visible = true;
			}
		}
		else
		{
			haveAppointments == false;
		}
		a = io.fileRead(a);
	}
	io.closeFile();

	ListBox1->Sorted = true;

	if ( haveAppointments == false )
	{
		ListBox1->Items->Append("There are no Appointments on  " + tdt.DateString());
		Label4->Visible = false;
	}
}
开发者ID:kanturan,项目名称:appointment-calendar,代码行数:49,代码来源:GUI.cpp

示例2:

//---------------------------------------------------------------------------
void __fastcall TfrmSearch::BitBtn1Click(TObject *Sender)
{
//
    AnsiString sql,case1,case2;
    TDateTime dt = dt2->Date;
    dt+=1;
    sql = "SELECT * FROM TEST ";
    if(ckRadius->Checked){
        case1 = " WHERE ";
        case2 = " RADIUS='"+AnsiString(cbDevRadius->ItemIndex)+"' ";
        sql += case1+case2;
    }

    if(ckTime->Checked){
        //case1 = " WHERE ";

        if(ckRadius->Checked){
            sql +=" AND ";
        }else{
            sql +="  WHERE ";
        }
        case2 = " OPTTIME BETWEEN #"+dt1->DateTime.DateString()+\
        "# AND #" +dt.DateString()+"# ";
        sql +=case2;
    }

    query->Close();
    query->SQL->Text = sql;
    query->Open();
    

}
开发者ID:adoggie,项目名称:Transformer,代码行数:33,代码来源:search.cpp


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