> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Carl Reynolds
> Sent: Friday, 17 December 1999 17:21
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Date/Time calculations
>
>
> No. There is no standard Delphi method to do what you're talking about,
> because it's not actually possible. The number is a real number of days,
> and can't be converted verbatim into years, months and days, because to do
> that you need to know the date on which you begin. A value of 31
> counted as
> 0 years, 1 month and 1 day last month, but as 0 years, 1 month and 0 days
> this month. If I go Decode(31, Years, Months Days);, then which
> is correct?
> Depends when you start because every month and year is different.
But I do know the dates and times in question - the DOB and Date values are
known.
> You were trying to go Decode(TDateTime(31), Years, Months, Days).
> Subtracting 30/12/1899 from the Years won't help - not unless you always
> want your age calculated as X days from 30/12/1899 (a date's idea of 0).
A person's age is their date of birth subtracted from the current date. The
30/12/1899 offset is an arbitrary one (Delphi1 used a date calculated from
the year 1; Pdox uses 9999 BC.
How does one store a date less than 1899 using a Delphi program?
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz