C++ Builder 参考手册 ➙ System::Dateutils ➙ DateOf
提取日期时间当中的日期
头文件:#include <System.DateUtils.hpp>
命名空间:System::Dateutils
函数原型:
System::TDateTime __fastcall DateOf(const System::TDateTime AValue);
参数:
- AValue:日期时间类型变量;
返回值:
- 返回值为提取日期时间当中的日期,时间部分等于 0,即 00:00:00。
例:从当前系统时间里面提取日期部分和时间部分:
#include <System.DateUtils.hpp>
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TDateTime dt = Sysutils::Now();
TDateTime d = Dateutils::DateOf(dt);
TDateTime t = Dateutils::TimeOf(dt);
Memo1->Lines->Add(d);
Memo1->Lines->Add(t);
}
运行结果
相关:
- System::Dateutils::DateTimeToUnix
- System::Dateutils::DayOf
- System::Dateutils::DayOfTheMonth
- System::Dateutils::DayOfTheWeek
- System::Dateutils::DayOfTheYear
- System::Dateutils::DecodeDateTime
- System::Dateutils::EncodeDateTime
- System::Dateutils::HourOf
- System::Dateutils::MilliSecondOf
- System::Dateutils::MinuteOf
- System::Dateutils::MonthOf
- System::Dateutils::SecondOf
- System::Dateutils::TryEncodeDateTime
- System::Dateutils::UnixToDateTime
- System::Dateutils::YearOf
- System::Dateutils
- System::Sysutils::CurrentYear
- System::Sysutils::Date
- System::Sysutils::DecodeDate
- System::Sysutils::DecodeDateFully
- System::Sysutils::DecodeTime
- System::Sysutils::EncodeDate
- System::Sysutils::EncodeTime
- System::Sysutils::FormatDateTime
- System::Sysutils::Now
- System::Sysutils::Time
- System::Sysutils::TryEncodeDate
- System::Sysutils::TryEncodeTime
- System::Sysutils::TryStrToDate
- System::Sysutils::TryStrToDateTime
- System::Sysutils::TryStrToTime
- System::Sysutils
C++ Builder 参考手册 ➙ System::Dateutils ➙ DateOf
网友评论