RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.TryEncodeDateDay Function

Calculates the TDateTime value that represents a specified day of the year for a specified year.

Pascal
function TryEncodeDateDay(const AYear: Word; const ADayOfYear: Word; out AValue: TDateTime): Boolean;
C++
Boolean TryEncodeDateDay(const Word AYear, const Word ADayOfYear, TDateTime AValue);

TryEncodeDateDay calculates the TDateTime value for the date specified by the AYear and ADayOfYear parameters.  

AYear is the year. It can be any value between 1 and 9999 (inclusive). 

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

AValue returns the specified date as a TDateTime value. The time portion of AValue is 0 (Midnight at the start of the specified day). 

TryEncodeDateDay returns T true if AYear and ADayOfYear represent a valid date, and F false if ADayOfYear is less than 1 or greater than the number of days in AYear. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!