C++ Builder 參考手冊(cè) ? System::Dateutils ? StartOfTheYear
這個(gè)日期時(shí)間所在年的最開始時(shí)間,這一年的 1 月 1 日 00:00:00.000
頭文件:#include <System.DateUtils.hpp>
命名空間:System::Dateutils
函數(shù)原型:
System::TDateTime __fastcall StartOfTheYear(const System::TDateTime AValue);
參數(shù):
- AValue:日期時(shí)間桥爽;
返回值:
- 這個(gè)日期時(shí)間所在年的最開始時(shí)間,這一年的 1 月 1 日 00:00:00.000伟葫;
- 比較函數(shù) StartOfAYear 和 StartOfTheYear:
? StartOfAYear 的參數(shù)是一個(gè)整數(shù)年砚嘴;
? StartOfTheYear 的參數(shù)是日期時(shí)間紊扬;
只要這兩個(gè)函數(shù)參數(shù)的年相同睛榄,返回值就相同户敬。
例:
#include <System.DateUtils.hpp>
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", StartOfTheYear(dt)));
Memo1->Lines->Add(FormatDateTime(L"yyyy/mm/dd hh:nn:ss.zzz", EndOfTheYear(dt)));
}
運(yùn)行結(jié)果:
相關(guān):
- 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::DaysInYear
- System::Dateutils::DaysInAYear
- System::Dateutils::DaysInMonth
- System::Dateutils::DaysInAMonth
- System::Dateutils::WeeksInYear
- System::Dateutils::WeeksInAYear
- System::Dateutils
C++ Builder 參考手冊(cè) ? System::Dateutils ? StartOfTheYear