RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.EndOfTheWeek Function

Returns a TDateTime that represents the last millisecond of the last day of the week identified by a specified TDateTime.

Pascal
function EndOfTheWeek(const AValue: TDateTime): TDateTime;
C++
TDateTime EndOfTheWeek(const TDateTime AValue);

EndOfTheWeek returns the last expressible moment of the same week as the TDateTime specified by AValue. That is, it replaces the time portion of AValue with 11:59:59.999 PM, changes the day to the last day of the week, and returns the result.

Note: EndOfTheWeek defines the week of AValue according to the ISO 8601 standard. That is, the week starts on Monday and ends on Sunday.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!