System.SysUtils.EncodeDate

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function EncodeDate(Year, Month, Day: Word): TDateTime;

C++

extern DELPHI_PACKAGE System::TDateTime __fastcall EncodeDate(System::Word Year, System::Word Month, System::Word Day);

Properties

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

Description

Returns a TDateTime value that represents a specified Year, Month, and Day.

EncodeDate returns a TDateTime value from the values specified as the Year, Month, and Day parameters.

The year must be from 1 through 9999.

Valid Month values are from 1 through 12.

Valid Day values are from 1 through 28, 29, 30, or 31, depending on the Month value. For example, the possible Day values for month 2 (February) are from 1 through 28 or from 1 through 29, depending on whether the Year value specifies a leap year.

If the specified values are not within range, EncodeDate raises an EConvertError exception.

See Also


Code Examples