System.DateUtils.WithinPastMonths

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

function WithinPastMonths(const ANow, AThen: TDateTime;
const AMonths: Integer): Boolean;

C++

extern DELPHI_PACKAGE bool __fastcall WithinPastMonths(const System::TDateTime ANow, const System::TDateTime AThen, const int AMonths);

プロパティ

種類 可視性 ソース ユニット
function public
System.DateUtils.pas
System.DateUtils.hpp
System.DateUtils System.DateUtils

説明

2 つの日付時刻値が互いに指定された月数内にあるかどうかを示します。

WithinPastMonths 関数を呼び出すと,ANow で指定された日付が AThen で指定された日付の AMonths の月数内にあるかどうかを確認できます。

メモ:  WithinPastMonths は,MonthsBetween 関数を使用します。つまり,端数はカウントされません。ANow と AThen が 2 月半離れている場合,AMonths を 2 に設定して WithinPastMonths を呼び出すと,true が返されます。

関連項目