[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'sysutils' (#rtl)

TryEncodeDate

Try to encode a date, and indicate success.

Declaration

Source position: datih.inc line 99

function TryEncodeDate(

  Year: Word;

  Month: Word;

  Day: Word;

  var Date: TDateTime

):Boolean;

Description

TryEncodeDatewill check the validity of the Year, Monthand Dayarguments, and if they are all valid, then they will be encoded as a TDateTimevalue and returned in D. The function will return Truein this case. If an inbvalid argument is passed, then Falsewill be returned.

Errors

None. If an error occurs during the encoding, Falseis returned.

See also

EncodeDate

  

Encode a Year,Month,Day to a TDateTimevalue.

DecodeDateFully

  

Decode a date with additional date of the week.

DecodeDate

  

Decode a TDateTimeto a year,month,day triplet

TryEncodeTime

  

Try to encode a time, and indicate success.