RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.YearSpan Function

Returns the approximate number of years (including fractions thereof) between two specified TDateTime values.

Pascal
function YearSpan(const ANow: TDateTime; const AThen: TDateTime): Double;
C++
Double YearSpan(const TDateTime ANow, const TDateTime AThen);

DateUtils

Call YearSpan to obtain the difference, in years, between two TDateTime values. Because years are not all the same length (e.g. leap years), YearsBetween returns an approximation based on an assumption of 365.25 days per year. Unlike the YearsBetween function, which does not report fractional years, YearSpan reports incomplete years as a fraction of a 365.25-day year. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!