RAD Studio VCL Reference
|
Returns a TDateTime that represents a specified day of a specified week in a specified year.
function EncodeDateWeek(const AYear: Word; const AWeekOfYear: Word; const ADayOfWeek: Word = 1): TDateTime;
TDateTime EncodeDateWeek(const Word AYear, const Word AWeekOfYear, const Word ADayOfWeek = 1);
EncodeDateWeek returns a TDateTime for the date specified by the AYear, AWeekOfYear, and ADayOfWeek parameters. The time portion of the return value is 0 (Midnight at the start of the specified day).
AYear is the year. It can be any value between 1 and 9999 (inclusive).
AWeekOfYear is the week within that year, where 1 is the first week that includes four or more days. Note that if the first calendar day of the year is a Friday, Saturday, or Sunday, then those three days must be expressed using AYear set to the previous year and AWeekOfYear set to the number of weeks in the previous year. Similarly, if the last calendar day of the year is a Monday, Tuesday, or Wednesday, then those three days are expressed with AYear set to the following year and AWeekOfYear set to 1.
ADayOfWeek is the day of the week, where 1 Monday, 2 is Tuesday, and so on.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|