Paul Brooks
asked on
Week of the year
Can anybody please give me an example of how to use the weekoftheyear routine. I have read the help file and it is as clear as mud. I have a date in a dateTime picker and i need to calculate the week No for a choosen date. I can see there is a routine that i can use but i just cant figure out how to use it
Many thanks
Many thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
var
w, y : word;
begin
w := WeekOf(DateTimePicker1.Dat e);
ShowMessage('Week no = ' + inttostr(w));
w := WeekOfTheYear(DateTimePick er1.Date); // Returns same as above
ShowMessage('Week no = ' + inttostr(w));
w := WeekOfTheYear(DateTimePick er1.Date, y); // same as above but y will have the year in which the returned week falls. To see the effect of year (last call) set the date to 1 jan 2006 and then set it to 2 jan 2006
ShowMessage('Week no = ' + inttostr(w) + ' Year=' + inttostr(y));
end;
w, y : word;
begin
w := WeekOf(DateTimePicker1.Dat
ShowMessage('Week no = ' + inttostr(w));
w := WeekOfTheYear(DateTimePick
ShowMessage('Week no = ' + inttostr(w));
w := WeekOfTheYear(DateTimePick
ShowMessage('Week no = ' + inttostr(w) + ' Year=' + inttostr(y));
end;
w, y : word;
begin
w := WeekOf(DateTimePicker1.Dat
ShowMessage('Week no = ' + inttostr(w));
w := WeekOfTheYear(DateTimePick
ShowMessage('Week no = ' + inttostr(w));
w := WeekOfTheYear(DateTimePick
week falls. To see the effect of year (last call) set the date to 1 jan 2006 and then set it to 2 jan 2006
end;