Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date 3 = Date1 - Date2;

Status
Not open for further replies.

LastCyborg

Programmer
Feb 7, 2003
256
MX
In Delphi I can obtain the number of days betwen 2 dates, but in BCB I can't

Example:
Date 3 = Date1 - Date2;

is there a way to make this easy like in delphi?
 
I think the TDatetime will help.

TDateTime t;
TDateTime s;
TDateTime u;

u = t - s;

you will have to get the dates and convert them to the TDateTime format using the TDateTime methods. After the
math then you will use these methods of TDateTime to format
the results in a useable form.

************
Converts the date of the TDateTime value to a string.

AnsiString __fastcall DateString() const;

*************
Converts an AnsiString object to a TDateTime object.

extern PACKAGE System::TDateTime __fastcall StrToDate(
const AnsiString S);

****************

look in "date/time routines".

Its been a while since I used TDateTime I do not have a ready example. sorry :(

tomcruz.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top