System.DateUtils.SecondsBetween

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function SecondsBetween(const ANow, AThen: TDateTime): Int64;

C++

extern DELPHI_PACKAGE __int64 __fastcall SecondsBetween(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 seconds between two specified TDateTime values.

Call SecondsBetween to obtain the difference, in seconds, between two TDateTime values. SecondsBetween counts only entire seconds. Thus, SecondsBetween reports the difference between 9:00:00 A.M. and 9:00:00:999 A.M. as 0, because the difference is one millisecond short of an entire second.

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

See Also


Code Examples