本文整理汇总了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;
}
}
示例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();
}