EndOfTheMonth function
Calculate a TDateTime value representing the last day of the month, given a day in that month.
Declaration
function EndOfTheMonth(const AValue: TDateTime): TDateTimeArguments
AValue | Day in the month of which the last day should be returned. |
Function result
TDateTime value representing the last day of the month in which
AVAlue is a day.
Description
EndOfTheMonth extracts the year and month parts of
AValue and
returns a
TDateTime value with the date of the first day of that year
and month as the
EndOfAMonth function.See also
Example: ex29
Program Example29;
{ This program demonstrates the EndOfTheMonth function }
Uses SysUtils,DateUtils;
Const
Fmt = '"last day of this month : "dd mmmm yyyy';
Begin
Writeln(FormatDateTime(Fmt,EndOfTheMonth(Today)));
End.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
