System.DateUtils.TryEncodeDateDay

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

extern DELPHI_PACKAGE bool __fastcall TryEncodeDateDay(const System::Word AYear, const System::Word ADayOfYear, /* out */ System::TDateTime &AValue);

Properties

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

Description

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

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

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.

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 True if AYear and ADayOfYear represent a valid date, and False if ADayOfYear is less than 1 or greater than the number of days in AYear.

See Also


Code Examples