MonthOfTheYear - C++ Builder
2022-08-01 本文已影响0人
玄坴
C++ Builder 参考手册 ➙ System::Dateutils ➙ MonthOfTheYear
这个日期时间所在的月份是这一年的第几个月
头文件:#include <System.DateUtils.hpp>
命名空间:System::Dateutils
函数原型:
System::Word __fastcall MonthOfTheYear(const System::TDateTime AValue);
参数:
- AValue:日期时间类型变量;
返回值:
- 这个日期时间所在的月份是这一年的第几个月,1 - 12;
- 这个函数和 MonthOf 的结果相同的,因为这一年的第几个月和这个月的月份是相同的。
例:
#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(MonthOf(dt));
Memo1->Lines->Add(MonthOfTheYear(dt));
}
相关:
- System::Dateutils::MonthOfTheYear
- System::Dateutils::WeekOfTheYear
- System::Dateutils::DayOfTheYear
- System::Dateutils::HourOfTheYear
- System::Dateutils::MinuteOfTheYear
- System::Dateutils::SecondOfTheYear
- System::Dateutils::MilliSecondOfTheYear
- System::Dateutils::DateOf
- 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::TimeOf
- 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 ➙ MonthOfTheYear