System.DateUtils.RecodeMonth

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

Delphi

function RecodeMonth(const AValue: TDateTime; const AMonth: Word): TDateTime;

C++

extern DELPHI_PACKAGE System::TDateTime __fastcall RecodeMonth(const System::TDateTime AValue, const System::Word AMonth);

プロパティ

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


説明

その年の月を、指定された TDateTime 値に対して置き換えます。

RecodeMonth を呼び出すと、AValue で指定された日時の値を、その年の月を AMonth に変更して取得された値に変換することができます。 AMonth の有効な値は、1 から 12 です。 AMonthRecodeLeaveFieldAsIs の場合もあります。

AMonth に対して提供された値が有効な月を表していなかった場合、もしくは、変更結果がその月の正しくない日付となっていた場合(たとえば、1月31日を2月31日に変更しようとするなど)、RecodeMonthEConvertError 例外を発生させます。

関連項目

コード サンプル