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

  • 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
1 Solution
rati7Author Commented:
its urgent please..
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

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 
Post your closing recommendations!  No comment means you don't care.

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