EndOfAMonth function
Calculate a TDateTime value representing the last day of the indicated month.
Declaration
function EndOfAMonth(const AYear: Word; const AMonth: Word): TDateTimeArguments
AYear | Year in which month occurs. |
AMonth | Month used to calculate the last day. |
Function result
TDateTime value indicating the last day of
AMonth in year
AYear.
Description
EndOfAMonth e
returns a
TDateTime value with the date of the last day of the
month indicated by the
AYear,
AMonth pair.See also
Example: ex31
Program Example31;
{ This program demonstrates the EndOfAMonth function }
Uses SysUtils,DateUtils;
Const
Fmt = '"Last day of this month : "dd mmmm yyyy';
Var
Y,M : Word;
Begin
Y:=YearOf(Today);
M:=MonthOf(Today);
Writeln(FormatDateTime(Fmt,EndOfAMonth(Y,M)));
End.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
