Time - C++ Builder

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


获取当前时间。

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

System::TDateTime __fastcall Time(void);

参数:

返回值:

  • 当前时间,当前地区的当前时间,本地的时间,精确到毫秒。

例:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    TDateTime dt = Sysutils::Time();
    ShowMessage(Sysutils::FormatDateTime(L"hh:nn:ss.zzz",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 ➙ Time

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