INTERVAL_TO_MS()
All functions > DATE AND TIME > INTERVAL_TO_MS()
Returns the truncated number of milliseconds in the given interval.
Signatures
Returns: The total number of milliseconds as BIGINT
INTERVAL_TO_MS(interval: INTERVAL) → BIGINT sql
| Parameter | Type | Required | Description |
|---|---|---|---|
interval | INTERVAL | Yes | An INTERVAL value to convert |
Notes
- Converts interval duration to milliseconds
- Returns truncated millisecond count
- Useful for duration calculations and comparisons
- Result is always a whole number (BIGINT)
- Sub-millisecond precision is truncated, not rounded
Examples
FeatureQL
SELECT
f1 := INTERVAL_TO_MS(INTERVAL_PARSE('1 second')), -- Convert 1 second to milliseconds
f2 := INTERVAL_TO_MS(INTERVAL_PARSE('5 minutes')) -- Convert 5 minutes to milliseconds
;Result
| f1 BIGINT | f2 BIGINT |
|---|---|
| 1000 | 300000 |
On this page