C++ Builder 参考手册 ➙ System::Dateutils ➙ Today
获取今天的日期
头文件:#include <System.DateUtils.hpp>
命名空间:System::Dateutils
函数原型:
System::TDateTime __fastcall Today(void);
参数:
- 无;
返回值:
例:测试和比较函数 Now、Date、Time、DateOf、TimeOf、Today、Yesterday、Tomorrow:
#include <System.DateUtils.hpp>
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Sysutils::FormatSettings.ShortDateFormat = L"yyyy'年'mm'月'dd'日'";
Sysutils::FormatSettings.LongTimeFormat = L"hh:nn:ss";
Memo1->Lines->Add(Sysutils::Now());
Memo1->Lines->Add(Dateutils::DateOf(Sysutils::Now()));
Memo1->Lines->Add(Sysutils::Date());
Memo1->Lines->Add(Dateutils::TimeOf(Sysutils::Now()));
Memo1->Lines->Add(Sysutils::Time());
Memo1->Lines->Add(Dateutils::Today());
Memo1->Lines->Add(Dateutils::Today()-1);
Memo1->Lines->Add(Dateutils::Yesterday());
Memo1->Lines->Add(Dateutils::Today()+1);
Memo1->Lines->Add(Dateutils::Tomorrow());
}
相关:
- System::Dateutils::Today
- System::Dateutils::Yesterday
- System::Dateutils::Tomorrow
- System::Dateutils::DateOf
- System::Dateutils::TimeOf
- System::Dateutils::IsToday
- System::Dateutils::IsSameDay
- System::Dateutils
- System::Sysutils::CurrentYear
- System::Sysutils::Date
- System::Sysutils::Now
- System::Sysutils::Time
- System::Sysutils
C++ Builder 参考手册 ➙ System::Dateutils ➙ Today
网友评论