Click or drag to resize

ElapTime Function

Return the difference between two time strings.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax
 FUNCTION ElapTime(
	cStartTime AS STRING,
	cEndTime AS STRING
) AS STRING
View Source

Parameters

cStartTime
Type: String
The starting time in the form hh:mm:ss.
cEndTime
Type: String
The ending time in the form hh:mm:ss.

Return Value

Type: String
The amount of time that has elapsed from <cStartTime> to <cEndTime> as a time string in the format hh:mm:ss.
Remarks
ElapTime() calculates the difference between two time strings by subtracting <cStartTime> from <cEndTime>.
Examples
These examples illustrate ElapTime():
X#
? ElapTime("03:02:01", "09:09:09")                // 06:07:08
? ElapTime("09:05:12", "23:10:07")                // 14:04:55
// Time elapsed from 11pm to 5am
? ElapTime("23:00:00", "05:00:00")                // 06:00:00
// Time elapsed from 5am to 11pm
? ElapTime("05:00:00", "23:00:00")                // 18:00:00
? ElapTime(Time(), "20:01:03")                
// Depends on current time

System Library
See Also