TryEncodeDateDay function
Encode a year and day of year to a
TDateTime value.
Declaration
function TryEncodeDateDay(const AYear: Word; const ADayOfYear: Word;
out AValue: TDateTime): BooleanArguments
AYear | Year. |
ADayOfYear | Day in the year. |
AValue | Encoded
|
Function result
True if the encoding was successful,
False if not.Description
TryEncodeDateDay encodes the values
AYear
and
ADayOfYear to a date value and returns this value in
AValue.
If the encoding was successful, True is returned.
False is returned if any of the arguments is not valid.
See also
- EncodeDateDay
- EncodeDateTime
- EncodeDateMonthWeek
- EncodeDateWeek
- TryEncodeDateTime
- TryEncodeDateMonthWeek
- TryEncodeDateWeek
Example: ex84
Program Example84;
{ This program demonstrates the TryEncodeDateDay function }
Uses SysUtils,DateUtils;
Var
Y,DoY : Word;
TS : TDateTime;
Begin
DecodeDateDay(Now,Y,DoY);
If TryEncodeDateDay(Y,DoY,TS) then
Writeln('Today is : ',DateToStr(TS))
else
Writeln('Wrong year/day of year indication');
End.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
