System.DateUtils.DaysBetween

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function DaysBetween(const ANow, AThen: TDateTime): Integer;

C++

extern DELPHI_PACKAGE int __fastcall DaysBetween(const System::TDateTime ANow, const System::TDateTime AThen);

Properties

Type Visibility Source Unit Parent
function public
System.DateUtils.pas
System.DateUtils.hpp
System.DateUtils System.DateUtils

Description

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

Call DaysBetween to obtain the difference, in days, between two TDateTime values.

DaysBetween counts only whole days. Thus, DaysBetween reports the difference between Dec 31, 1999 11:59 P.M. and Jan 1, 2000 11:58 P.M. as 0, because the difference is one minute short of an entire day.

DaysBetween always returns a positive result and therefore the parameter values are interchangeable.

See Also


Code Examples