Date Month End

Submitted by:J Kamy81

Date added:03 April, 2018

Category:Delphi

Returns the last day of the month containing the given date.

Tags: date , month

Code Snippet:

function DateMonthEnd(const DT: TDateTime): TDateTime;
var
Day, Month, Year: Word;
LastDay: Byte;
begin
SysUtils.DecodeDate(DT, Year, Month, Day);
LastDay := DaysInMonth(DT);
Result := SysUtils.EncodeDate(Year, Month, LastDay);
end;
 
 

Comments