Click or drag to resize

ElapTime Function

X#
Return the difference between two time strings.

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

Parameters

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

Return Value

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

System Library
See Also