System.DateUtils.RecodeYear
Delphi
function RecodeYear(const AValue: TDateTime; const AYear: Word): TDateTime;
C++
extern DELPHI_PACKAGE System::TDateTime __fastcall RecodeYear(const System::TDateTime AValue, const System::Word AYear);
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.DateUtils.pas System.DateUtils.hpp |
System.DateUtils | System.DateUtils |
Description
Replaces the year for a specified TDateTime value.
Call RecodeYear to convert the date/time value specified by AValue with the value obtained by changing the year to AYear. Legal values for AYear range from 1 through 9999. AYear can also be RecodeLeaveFieldAsIs.
If the value provided for AYear is not in the legal range, or if the change results in an invalid day of the month (changing February 29 on a leap year to a non-leap year), RecodeYear raises an EConvertError exception.
See Also
- System.SysUtils.ReplaceDate
- System.DateUtils.RecodeMilliSecond
- System.DateUtils.RecodeSecond
- System.DateUtils.RecodeMinute
- System.DateUtils.RecodeHour
- System.DateUtils.RecodeDay
- System.DateUtils.RecodeMonth
- System.DateUtils.YearOf
- System.DateUtils.RecodeTime
- System.SysUtils.EConvertError
- Date and Time Support