Subject | Re: Caculating specific dates for each year |
---|---|
Author | nxciro |
Post date | 2006-04-27T12:23:11Z |
We are getting off topic
Here is a routine in Delphi for our
bizyear which is april 1 to march 31
it should be easy to adjust for whatever period
procedure bizyear;
var Present : TDateTime;
Year, Month, Day, ya, yb : Word;
begin
//BIZYEAR ROUTINE
ya := 2000; //just some start value
yb := 2000;
Present := Now;
DecodeDate(Present, Year, Month, Day);
if (MONTH >= 4) AND (MONTH <= 12) then
begin
ya := year;
yb := year + 1;
end
else
begin if (MONTH >= 1) AND (MONTH <= 3) THEN
begin
yb := year;
ya := yb - 1;
end
end;
datetimepicker1.date := strtodate('04/01/' + inttostr(ya));
datetimepicker2.date := strtodate('03/31/' + inttostr(yb));
end;
Here is a routine in Delphi for our
bizyear which is april 1 to march 31
it should be easy to adjust for whatever period
procedure bizyear;
var Present : TDateTime;
Year, Month, Day, ya, yb : Word;
begin
//BIZYEAR ROUTINE
ya := 2000; //just some start value
yb := 2000;
Present := Now;
DecodeDate(Present, Year, Month, Day);
if (MONTH >= 4) AND (MONTH <= 12) then
begin
ya := year;
yb := year + 1;
end
else
begin if (MONTH >= 1) AND (MONTH <= 3) THEN
begin
yb := year;
ya := yb - 1;
end
end;
datetimepicker1.date := strtodate('04/01/' + inttostr(ya));
datetimepicker2.date := strtodate('03/31/' + inttostr(yb));
end;