Skip to content

SecondOfTheMonth ​

SecondOfTheMonth returns the number of seconds between the TDateTime value entered as AValue, and 12:00 A.M. of the first day of the month that is specified by AValue.

This may be a large number.

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

A simple example follows.

pascal
procedure ScriptEvent (var Value : variant);
var
  TheSec : cardinal;
begin
 //If YESTERDAY is 29-11-2023, the result is 2419200
  TheSec := SecondOfTheMonth(Yesterday);
  LogInfo('The number of seconds since 1st Nov 23 is '+IntToStr(TheSec));
end;