Date - C++ Builder

C++ Builder 参考手册 ➙ System::Sysutils ➙ Date


获取当前日期

头文件:#include
命名空间:System::Sysutils
函数原型:

System::TDateTime __fastcall Date(void);

参数:

返回值:

  • 当前日期,当前地区的当前日期,本地时间的日期。

例:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    TDateTime dt = Sysutils::Date();
    ShowMessage(DateTimeToStr(dt));
}

运行结果:

运行结果

相关:

  • System::Sysutils::CurrentYear
  • System::Sysutils::Now
  • System::Sysutils::Date
  • System::Sysutils::Time
  • System::Sysutils::DecodeDate
  • System::Sysutils::DecodeDateFully
  • System::Sysutils::DecodeTime
  • System::Sysutils::EncodeDate
  • System::Sysutils::EncodeTime
  • System::Sysutils::TryEncodeDate
  • System::Sysutils::TryEncodeTime
  • System::Sysutils::TryStrToDate
  • System::Sysutils::TryStrToDateTime
  • System::Sysutils::TryStrToTime
  • System::Sysutils
  • System::Dateutils::DayOfTheYear
  • System::Dateutils::DayOfTheMonth
  • System::Dateutils::DayOfTheWeek
  • System::Dateutils::DayOf
  • System::Dateutils::HourOf
  • System::Dateutils::SecondOf
  • System::Dateutils::MinuteOf
  • System::Dateutils::MilliSecondOf
  • System::Dateutils::DecodeDateTime
  • System::Dateutils::EncodeDateTime
  • System::Dateutils::TryEncodeDateTime
  • System::Dateutils

C++ Builder 参考手册 ➙ System::Sysutils ➙ Date

你可能感兴趣的:(Date - C++ Builder)