Re: Get day of year



On 1 Jun 2005 13:00:09 -0700, "pjwolters" <pjwolters@xxxxxxxxx>
waffled on about something:

>Yeah Thanks!
>
>I was indeed looking for the number of day in that year, it'sworking
>perfectly,
>
>Thnx,
>
>Peter

It's worth getting to grips with Delphi's Tdatetime type, it's quite a
useful one.

It's the number of days since 12:00 am 30th December 1899.

So if you add 1 to a Tdatetime you'll have the date for the next day.

The crafty thing is it also has the hours and minutes part for
fractions of the day.

So if you wanted to know what the time would be in 12 hours time you
just take the current time in Tdatetime format (oh looks, there's one
provided for you, it's called NOW), and add 12 hours to it... 12 Hours
is half a day, so that's NOW+0.5.

All that's left is to display the new time. datetimetostr does that
for you.

Dodgy.
--
MUSHROOMS ARE THE OPIATE OF THE MOOSES
.