Count seconds between 2 Date Time fields

Count seconds between 2 Date Time fields

Hi,

We have always worked out the time between 2 x date time fields and output them as 'Hours and Minutes' as below:

  1. string CalculateDuration(Date Start, Date End)
  2. {
  3. Duration = (((End - Start)) / (1000 * 3600)).toLong() + " Hour " + (((((End - Start)) / (1000 * 3600)).toDecimal() - (((End - Start)) / (1000 * 3600)).toLong()) * 60).toLong() + " Min";
  4. return Duration;
  5. }

The need has now arisen to calculate the Minutes and Seconds. I have tried many equations to no joy.

How would I do this please?
Regards