Skip to content

NovaStar Database Reference / Functions / interval_to_seconds


Overview

The interval_to_seconds function takes an interval in the format HH:MM:SS and returns the number of seconds in that interval.

It is defined in the interval.sql file distributed with the NovaStar installer.

Function Usage

The function syntax is as follows.

interval_to_seconds(
  IN interval_req interval)

The function returns an integer.

Function parameters are as follows.

Function Parameters

Parameter         Description
interval The interval to convert to a number of seconds.

The following returns the number of seconds in the interval 00:01:30, which is 90.

select * from interval_to_seconds('00:01:30');

Troubleshooting

See Also