The function EndOfTheDay returns a TDateTime value that represents the last expressible millisecond moment of the day specified by AValue.
The time portion of AValue is replaced by 23:59:59:999.
Declaration: Function EndOfTheDay(const AValue: TDateTime): TDateTime;
The example follows.