Delphi Examples: DbiDateDecode

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Delphi Examples: DbiDateDecode

Return to chapter overview

Decode a DBIDATE structure into month, day, and year numbers.

DbiDateDecode returns a string containing the date. Keep in mind that you need to use this function only when you are directly accessing BDE format dates. Otherwise, VCL handles this conversion for you.

This example uses the following input:

 fDbiDateDecode(MyDate, MyMonth, MyDay, MyYear);

 

The function is defined as:

function fDbiDateDecode(dateD: DbiDATE; var Month: word; var Day: word; var Year: SmallInt): String;

begin

 Check(DbiDateDecode(dateD, Month, Day, Year));

 Result := Format('%d/%d/%d', [Month, Day, Year]);

end;