Returns the week of the month represented by a TDateTime value.
function WeekOfTheMonth(const AValue: TDateTime): Word; overload; function WeekOfTheMonth(const AValue: TDateTime; var AYear: Word; var AMonth: Word): Word; overload;
Word WeekOfTheMonth(const TDateTime AValue); Word WeekOfTheMonth(const TDateTime AValue, Word AYear, Word AMonth);
DateUtils
Call WeekOfTheMonth to obtain the week of the month represented by a specified TDateTime value. WeekOfTheMonth returns a value between 1 and 6.
AYear and AMonth return the year and month in which WeekOfTheMonth occurs. Note that these values may not be the same as the year and month of AValue. This is because the first week of a month is defined as the first week with four or more days in that month. Thus, if the first day of the month is a Friday, Saturday, or Sunday, the first one, two, or three days of the month are defined as belonging to the last week of the previous month. Similarly, if the last day of the month is a Monday, Tuesday, or Wednesday, then the last one, two, or three days of the month are defined as belonging to the first week of the next month.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|