Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1082
  • Last Modified:

how to program a time span calculator in delphi?

The program is required to readdata from a text file.For each record in the file,calculate the time leapsed(in years and days) between the start and end days.consider leap years

The earliest valid date will be Jan 1, 1900, and the latest
valid date will be December 31, 2100.

how do i program this in delphi7?
please help..its urgent
0
rati7
Asked:
rati7
1 Solution
 
rati7Author Commented:
its urgent please..
0
 
GriffonCommented:
what exactly dont you know how to do? you read from the text file using 'Assignfile'(to assign file) and 'readln'(to get the line first to last).

then just do a string to datetime conversion and subtract one date from the other..

this will leave you with an value if read as an integer that will be equal to the number of days between the two dates. And I would have thought the number of days would be more use than anything else as the number of months or years would be inconclusive due to their varying lengths.

Hope this is of help

Griffon.
0
 
CleanupPingCommented:
rati7:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now