Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

compareTime

compareTime( 
t_time1 
t_time2 
) 
=> x_difference

Description

Compares two string arguments, representing a clock-calendar time.

Arguments

t_time1

First string in the month day hour:minute:second year format.

t_time2

Second string in the month day hour:minute:second year format.

Value Returned

x_difference

An integer representing a time that is later than (positive), equal to (zero), or earlier than (negative) the second argument. The units are seconds.

Examples

In the following example, 687,777 seconds have occurred between the two dates given. For a positive number of seconds, the most recent date needs to be given as the first argument.

compareTime( "Apr 8 4:21:39 1991" "Apr 16 3:24:36 1991")
=> -687777.

In the following example, 600 seconds (10 minutes) have occurred between the two dates.

compareTime("Apr 16 3:24:36 1991" "Apr 16 3:14:36 1991")
=> 600

Related Topics

Logical and Relational Functions

getCurrentTime


Return to top
 ⠀
X