DecodeDateTime reverse engineers a date AValue, and returns the date broken into its various parts.

The given parameters are populated with the parts of the date, so that you can then use the variables in your calculations.

This is the opposite of EncodeDateTime EncodeDateTime.

Declaration: procedure DecodeDateTime(const AValue: TDateTime; out AYear: Word; out AMonth: Word; out ADay: Word; out AHour: Word; out AMinute: Word; out ASecond: Word; out AMilliSecond: Word);procedure DecodeDateTime(const AValue: TDateTime; out AYear: Word; out AMonth: Word; out ADay: Word; out AHour: Word; out AMinute: Word; out ASecond: Word; out AMilliSecond: Word);

Such as the example below.

procedure OnMapEvent(var Value:Variant);
var
lYear, lMonth, lDay, lHour, lMin, lSec, lMil : word;
 
begin
//Break date/time into its individual parts
DecodeDateTime(Now, lYear, lMonth, lDay, lHour, lMin, lSec, lMil);
 
if ((lDay=1) and (lHour=13)) then
 
...do something at this special time...;
 
end;