HourOfTheMonth returns the number of complete hours between the TDateTime value entered as AValue, and 12:00 A.M. of the first day of the month that is specified by AValue.
Declaration: Function HourOfTheMonth(const AValue: TDateTime): Word;
A simple example follows.
procedure ScriptEvent (var Value : variant);
var
TheHour : word;
begin
//If YESTERDAY is 29-11-2023, the result is 672
TheHour := HourOfTheMonth(Yesterday);
LogInfo('The number of hours since 1st Nov 23 is '+IntToStr(TheHour));