From RAD Studio API Documentation
Jump to: navigation, search


function EncodeDateDay(const AYear, ADayOfYear: Word): TDateTime;


extern DELPHI_PACKAGE System::TDateTime __fastcall EncodeDateDay(const System::Word AYear, const System::Word ADayOfYear);


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


Returns a TDateTime that represents a specified day of the year for a specified year.

EncodeDateDay returns a TDateTime for the date specified by the AYear and ADayOfYear parameters. The time portion of the return value is 0 (midnight at the start of the specified day).

AYear is the year. It can be any value from 1 through 9999 (inclusive).

ADayOfYear is the day of the year, where 1 is January 1, 2 is January 2, 32 is February 1, and so on.

If AYear is not within range, or if ADayOfYear is less than 1 or greater than the number of days in AYear, EncodeDateDay raises an EConvertError exception.

See Also

Code Examples