StartOfAMonth returns a TDateTime value that represents 12:00:00:00 A.M. on the first day of a specified month and year, by returning the first expressible moment of the year specified by AYear and the month specified by AMonth.

Declaration: Function StartOfAMonth(const AYear, AMonth : Word) : TDateTime;

An example follows and with a processing year of 2023 and month of 7, the function returns 01/07/2023 00:00:00.

procedure OnMapEvent(var Value:Variant);
var
TheYear, TheMonth : word;
TheDate : TDateTime;
begin
TheYear := 2023;
TheMonth := 7;
TheDate := StartOfAMonth(TheYear, TheMonth);
LogInfo('The start of the month date is '+FormatDateTime('dd/mm/yyyy hh:nn:ss',TheDate));
end;

Also refer to StartOfTheMonth for similar functionality.