System.DateUtils.RecodeDate
Delphi
function RecodeDate(const AValue: TDateTime; const AYear, AMonth, ADay: Word): TDateTime;
C++
extern DELPHI_PACKAGE System::TDateTime __fastcall RecodeDate(const System::TDateTime AValue, const System::Word AYear, const System::Word AMonth, const System::Word ADay);
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
function | public | System.DateUtils.pas System.DateUtils.hpp |
System.DateUtils | System.DateUtils |
説明
指定された TDateTime 値の日付部分を置換します。
RecodeDate を呼び出すと,AValue で指定された日付時刻値を,年を AYear に,月を AMonth に,日を ADay に変更して得られた値で変換できます。
AYear は,1 ~ 9999 の範囲の値でなければなりません。
AMonth は,1 ~ 12 の範囲で指定できます。
ADay の有効な値の範囲は,AMonth で表された月によって異なります。たとえば,AMonth が 1 の場合,ADay の有効な値の範囲は 1 ~ 31 です。AMonth が 2 の場合,有効な値の範囲は年に応じて 1 ~ 28 または 1 ~ 29 です。
AYear,AMonth,および ADay で指定された値が有効な日付を表していない場合,RecodeDate は EConvertError 例外を生成します。