Show: Delphi C++
Display Preferences

System.DateUtils.RecodeDate

From RAD Studio API Documentation
Jump to: navigation, search

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);

Properties

Type Visibility Source Unit Parent
function public
System.DateUtils.pas
System.DateUtils.hpp
System.DateUtils System.DateUtils

Description

Selectively replaces the date parts of a specified TDateTime value.

Call RecodeDate to convert the date/time value specified by AValue with the value obtained by changing the year to AYear, the month to AMonth, and the day of the month to ADay.

AYear must range from 1 through 9999 (or be RecodeLeaveFieldAsIs).

AMonth can range from 1 through 12 (or be RecodeLeaveFieldAsIs).

Legal values for ADay depend on the month represented by AMonth. (For example, if AMonth is 1, ADay can range from 1 through 31, if AMonth is 2, ADay can range from 1 through 28 or 1 to 29, depending on the year, and so on.) ADay can also be RecodeLeaveFieldAsIs.

If the values provided for AYear, AMonth, and ADay do not represent a valid date, RecodeDate raises an EConvertError exception.

See Also

Code Examples

Personal tools
In Other Languages
Previous Versions
Assistance