Re: finding the day of the year




"Bruce Roberts" <ber@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:93QFe.2578$d02.549305@xxxxxxxxxxxxxxxxxxxxxxxx

> function DayOfYear (aDate : tDateTime) : integer;
>
> var yr, mth, day : word;
>
> begin
> DecodeDate (aDate, yr, mth, day);
> result := (aDate - EncodeDate (yr, 1, 1)) + 1;

correction

result := Trunc (aDate - EncodeDate (yr, 1, 1)) + 1;

> end;



.



Relevant Pages