Count the Number of Seconds between Two Times

To count the number of seconds between two times, you use one of the Second Difference functions with date and time inputs.

The Second Difference function returns the number of whole seconds between two datetimes. This calculation includes only one endpoint.

For example:

the number of seconds between first place and second place = SecondDifference(the first place time, the second place time)

The number of seconds between first place and second place would be 15 with the following inputs:

  • the first place time is 03/06/2019 13:00:05
  • the second place time is 03/06/2019 13:00:20.

The Second Difference Inclusive function returns the number of whole seconds (inclusive) between two datetimes. This calculation includes both endpoints. Used with the same inputs as above, the number of seconds between first place and second place would be 16.

The Second Difference Exclusive function returns the number of whole seconds (exclusive) between two datetimes. This calculation excludes both endpoints. Used with the same inputs as above, the number of seconds between first place and second place would be 14.

Note: The order of the two datetimes in the function does not affect the result.