Sign in Join
FPDoc Onlineexperiment

TryEncodeDate function

In unit sysutils

Try to encode a date, and indicate success.

Declaration

pascal
function TryEncodeDate(Year: Word; Month: Word; Day: Word; 
 out Date: TDateTime): Boolean

Description

TryEncodeDate will check the validity of the Year, Month and Day arguments, and if they are all valid, then they will be encoded as a TDateTime value and returned in Date. The function will return True in this case. If an invalid argument is passed, then False will be returned.

Errors

None. If an error occurs during the encoding, False is returned.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.