SecondsAfter

Description

Determines the number of seconds one time occurs after another.

Syntax

SecondsAfter ( time1, time2 )

Argument

Description

time1

A time value that is the start time of the interval being measured

time2

A time value that is the end time of the interval

Returns

Long. Returns the number of seconds time2 occurs after time1. If time2 occurs before time1, SecondsAfter returns a negative number. If any argument’s value is null, SecondsAfter returns null.

Examples

Example 1

This statement returns 15:

SecondsAfter(21:15:30, 21:15:45)

Example 2

This statement returns -15:

SecondsAfter(21:15:45, 21:15:30)

Example 3

This statement returns 0:

SecondsAfter(21:15:45, 21:15:45)

Example 4

If you declare start_time and end_time time variables and assign 19:02:16 to start_time and 19:02:28 to end_time as shown below:

time start_time, end_time

start_time = 19:02:16

end_time = 19:02:28

Example 5

then each of these statements returns 12:

SecondsAfter(start_time, end_time)

SecondsAfter(19:02:16, end_time)

SecondsAfter(start_time, 19:02:28)

SecondsAfter(19:02:16, 19:02:28)

See also