RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.EndOfAWeek Function

Returns a TDateTime object value that represents the last millisecond of a specified day of a specified week.

Pascal
function EndOfAWeek(const AYear: Word; const AWeekOfYear: Word; const ADayOfWeek: Word = 7): TDateTime;
C++
TDateTime EndOfAWeek(const Word AYear, const Word AWeekOfYear, const Word ADayOfWeek = 7);

EndOfAWeek returns the last expressible moment (11:59:59.999 PM) of the specified day of the specified week. 

The AYear parameter specifies the year of the desired day. 

The AWeekOfYear parameter specifies the week of the year, where 1 is the first week in AYear that includes four or more days.  

The ADayOfWeek parameter indicates the desired day in the specified week, where 1 is Monday, 2 is Tuesday, and so on.

Tip: To make the ADayOfWeek value more readable, use the day of week constants.
If the parameters do not specify a valid date, EndOfAWeek raises an EConvertError exception.
Note: The definitions for AWeekOfYear and ADayOfWeek follow the ISO 8601 standard.
 

 

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