# Interval - script and chart function

Interval() formats a number as a time interval using the format in the system variables in the load script, or the operating system, or a format string, if supplied.

Intervals may be formatted as a time, as days or as a combination of days, hours, minutes, seconds and fractions of seconds.

Syntax:

Interval(number[, format])

Return data type: dual

Arguments:

Interval arguments

| Argument | Description |
| --- | --- |
| number | The number to be formatted. |
| format | String describing how the resulting interval string is to be formatted. If omitted, the short date format, time format, and decimal separator set in the operating system<br>are used. |

Examples:

The examples below assume the following default settings:

* Date format setting 1: YY-MM-DD
* Date format setting 2: hh:mm:ss
* Number decimal separator: .

Examples and results

| Example | String | Number |
| --- | --- | --- |
| `Interval(<br>A )`<br><br>where A=0.375 | 09:00:00 | 0.375 |
| `Interval( A )`<br><br>where A=1.375 | 33:00:00 | 1.375 |
| `Interval( A, 'D hh:mm' )`<br><br>where<br>A=1.375 | 1<br>09:00 | 1.375 |
| `Interval(<br>A-B, 'D hh:mm' )`<br><br>where A=97-08-06 09:00:00 and B=96-08-06 00:00:00 | 365<br>09:00 | 365.375 |