EndOfTheDay - C++ Builder

C++ Builder 参考手册 ➙ System::Dateutils ➙ EndOfTheDay


这个日期时间所在天的结束时间,这一天的 23:59:59.999

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

System::TDateTime __fastcall EndOfTheDay(const System::TDateTime AValue);

参数:

  • AValue:日期时间;

返回值:

  • 这个日期时间所在天的结束时间,这一天的 23:59:59.999;
  • 程序通常判断小于下一天的开始时间 00:00:00.000,而不是判断小于等于这一天的结束时间。

例:

#include 
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    TDateTime dt = Sysutils::Now();
    Memo1->Lines->Add(FormatDateTime(L"yyyy/mm/dd hh:nn:ss.zzz", dt));
    Memo1->Lines->Add(FormatDateTime(L"yyyy/mm/dd hh:nn:ss.zzz", StartOfTheDay(dt)));
    Memo1->Lines->Add(FormatDateTime(L"yyyy/mm/dd hh:nn:ss.zzz", EndOfTheDay(dt)));
}

运行结果:


相关:

  • System::Dateutils::StartOfTheYear
  • System::Dateutils::EndOfTheYear
  • System::Dateutils::StartOfTheMonth
  • System::Dateutils::EndOfTheMonth
  • System::Dateutils::StartOfTheWeek
  • System::Dateutils::EndOfTheWeek
  • System::Dateutils::StartOfTheDay
  • System::Dateutils::EndOfTheDay
  • System::Dateutils::StartOfAYear
  • System::Dateutils::EndOfAYear
  • System::Dateutils::StartOfAMonth
  • System::Dateutils::EndOfAMonth
  • System::Dateutils::StartOfAWeek
  • System::Dateutils::EndOfAWeek
  • System::Dateutils::StartOfADay
  • System::Dateutils::EndOfADay
  • System::Dateutils::StartOfADay
  • System::Dateutils::EndOfADay
  • System::Dateutils::DaysInYear
  • System::Dateutils::DaysInAYear
  • System::Dateutils::DaysInMonth
  • System::Dateutils::DaysInAMonth
  • System::Dateutils::WeeksInYear
  • System::Dateutils::WeeksInAYear
  • System::Dateutils

C++ Builder 参考手册 ➙ System::Dateutils ➙ EndOfTheDay

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