Re: finding the day of the year



Jud McCranie wrote:
On Thu, 28 Jul 2005 08:24:26 +1200, anthony <mrmclarge@xxxxxxxxxxx>
wrote:


forgive me for being a bit dumb here, yes I have found the function and even found how to call it, I think this right DayOfTheYear(datetimepicker1.date); how do I get the result, where do I find that, Thank you for all your effort, I dont mean to bother you all but it's how I learn


uses controls, { for tDate}
       DateUtils; { for DayOfTheYear }

var ThisDate : tDate;  // or tDateTime


Then call DayOfTheYear(ThisDate) where ThisDate is the date you are working with. The function returns an integer giving the day number of the year (and it is correct for leap years, etc).

I think the DateUtils unit is only in Delphi 6 and later, but I'm not
certain about that.

---
Replace you know what by j to email


this does not return the day number but rather the very date I sent it, Hell I must be a dummy, I can not see how to get the actual day number




.



Relevant Pages

  • Re: Does printer have color?
    ... Bjørge Sæther wrote: ... > Jud McCranie wrote: ... >> How can you tell if a printer has color, from within a Delphi ... Nicholas Sherlock ...
    (comp.lang.pascal.delphi.misc)
  • Re: Set default project folder in D2005
    ... Jud McCranie wrote: ... > Delphi 2005? ... In the Registry, add a string entry DefaultProjectsDirectory to the ...
    (borland.public.delphi.non-technical)
  • Re: Delphi 2006 and win32
    ... > Jud McCranie wrote: ... >> I couldn't find the answer to this anywhere, but will Delphi 2006 ... >> said words to the effect that win32 was on the brink of extinction. ... Prev by Date: ...
    (borland.public.delphi.non-technical)
  • Re: Delphi 2006 and win32
    ... Jud McCranie wrote: ... > I assume that it will, but in Delphi 2005 Borland ... > said words to the effect that win32 was on the brink of extinction. ... "True peace is not the absence of tension, ...
    (borland.public.delphi.non-technical)