RAD Studio VCL Reference
|
Returns which occurrence of its weekday a specified TDateTime value represents.
function NthDayOfWeek(const AValue: TDateTime): Word;
Word NthDayOfWeek(const TDateTime AValue);
NthDayOfWeek indicates which occurrence of a weekday within a month the date and time specified by AValue represents. For example, if AValue represents the 2nd Tuesday of the month, NthDayOfWeek returns 2.
Note that this value may differ from the value that the WeekOfTheMonth function returns, because NthDayOfWeek counts every occurrence of the given weekday, while WeekOfTheMonth only counts a week if it includes 4 or more days in the month. Thus, for example, if AValue represents a Saturday that is the first day of a month, NthDayOfWeek returns 1, while WeekOfTheMonth returns 5 (or maybe 4), indicating the last week of the previous month.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|