RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.TryEncodeDate Function

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

Pascal
function TryEncodeDate(Year: Word; Month: Word; Day: Word; out Date: TDateTime): Boolean;
C++
Boolean TryEncodeDate(Word Year, Word Month, Word Day, TDateTime Date);

SysUtils

TryEncodeDate generates a TDateTime value from the values specified as the Year, Month, and Day parameters. 

The year must be between 1 and 9999. 

Valid Month values are 1 through 12. 

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

The Date parameter returns the generated value if TryEncodeDate returns true. 

If the specified values are not within range, TryEncodeDate returns false. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!