Date conversion

Posted on 2006-05-06
Last Modified: 2010-04-05

I have 2 TDateTime vars, and:

TDateTime1 has earlier date/time
TDateTime2 has later date/time

i need to calculate the difference between those two TDateTime vars and get the difference in seconds

for eg if the difference will become 2d 12h 30m 24s then the final int will be: 217,824 seconds

calculation from 2d 12h 30m 24s to seconds is not a problem, but i dont know how to get the difference between those TDateTime vars

please help

thx in advance
Question by:szafran81
    LVL 28

    Accepted Solution

    uses dateutils;

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

    Author Comment

    thx m8

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now