RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.WeeksBetween Function

Returns the number of whole weeks between two specified TDateTime values.

Pascal
function WeeksBetween(const ANow: TDateTime; const AThen: TDateTime): Integer;
C++
int WeeksBetween(const TDateTime ANow, const TDateTime AThen);

Call WeeksBetween to obtain the difference, in weeks, between two TDateTime values. WeeksBetween counts only whole Weeks. Thus, WeeksBetween reports the difference between January 1 at 12:00 AM and Jan 6 at 11:58 PM as 0 because the difference is one minute short of an entire week. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!