xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

ElapTime()

Calculates the time elapsed between a start and an end time.

Syntax

ElapTime( <cStartTime>, <cEndTime> ) --> cElapsedTime

Arguments

<cStartTime>
This is a Time() formatted character string containing the start time to use for the calculation. The time string must be coded using a 24h time format.
<cEndTime>
A time string containing the end time.

Return

The function returns a time-formatted character string holding the duration of the time interval in the format hh:mm:ss.

Description

This function returns a string that shows the difference between the starting time represented as <cStartTime> and the ending time as <cEndTime>. If the starting time is later than the ending time, the function assumes that the end time occured on the next day.

Info

See also:Days(), Time(), Secs(), Seconds()
Category: Date and time
Source:rtl\samples.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example shows return values of ElapTime()

   PROCEDURE Main
      LOCAL cStartTime := "17:30:15"

      ? ElapTime( cStartTime, "21:45:30" )  // result: 04:15:15

      ? ElapTime( cStartTime, "07:45:30" )  // result: 14:15:15
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe