Home Contents | # time:secsTo | Date/Time | Core4 Lua Commands

## SYNOPSIS

1. n = time:secsTo(ref)
2. n = time:msecsTo(ref)

## DESCRIPTION

Calculates the difference between two time values.

## RETURN VALUE

The time difference between ref and time in seconds or milliseconds, respectively.

## ERRORS

Raises an error if time or ref is not a time instance.

## EXAMPLE

> > >
t1 = clock.newTime(10, 30, 0) t2 = clock.newTime(12, 30, 0) print(t1:secsTo(t2))
7200

## SEE ALSO

clock.currentTime, clock.newTime, time(), time:addMSecs, time:addSecs, time:format, time:hour, time:isNull, time:isValid, time:millisecondsFromMidnight, time:minute, time:minutesFromMidnight, time:msec, time:second, time:secondsFromMidnight, time:set, tostring(time)