Skip to content

NovaStar Database Reference / Functions / interval_from_text


Overview

The interval_from_text function takes a string with a time unit and an integer (such as 2 minutes), and returns an interval in the format HH:MM:SS. If no time unit is specified, it assumes seconds.

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

Function Usage

The function syntax is as follows.

interval_from_text(
  IN timeintervaltext text)

The function returns an interval object.

Function parameters are as follows.

Function Parameters

Parameter         Description
timeintervaltext Text with an integer and a time unit, to transform into an interval.

The following creates an interval for 90 minutes, or 1 hour 30 minutes, in the output format 01:30:00.

select * from interval_from_text('90 minutes');

Troubleshooting

See Also