The MonthOf function returns the number of the month, represented by the given date value AValue. The month result is a number between 1 and 12.

Declaration: function MonthOf( const AValue : TDateTime) : Word

function MonthOfTheYear(const AValue: TDateTime): Word;

An example follows.

procedure OnMapEvent(var Value:Variant);
begin
//If the date is 2009-06-25 then the result is 6
Value := MonthOf(Date);
end;

MonthOf has the same functionality as the MonthOfTheYear function.