The MilliSecondOfTheHour function returns the number of milliseconds between the specified TDateTime value AValue, and the beginning of the same hour.

Declaration: Function MilliSecondOfTheHour( const AValue : TDateTime) : Cardinal;

A simple example of its use.

procedure ScriptEvent (var Value : variant);
var
TheSec : cardinal;
begin
TheSec := MilliSecondOfTheHour(Now);
LogInfo('Number of milliseconds is ' + IntToStr(TheSec));
LogInfo('');
end;