TO_MILLISECONDS
All functions > DATE AND TIME > TO_MILLISECONDS
Returns the truncated number of milliseconds in the given interval.
Signatures
Returns: The total number of milliseconds as BIGINT
TO_MILLISECONDS(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 := TO_MILLISECONDS(PARSE_DURATION('1 second')), -- Convert 1 second to milliseconds
f2 := TO_MILLISECONDS(PARSE_DURATION('5 minutes')) -- Convert 5 minutes to milliseconds
;Result
| f1 BIGINT | f2 BIGINT |
|---|---|
| 1000 | 300000 |
On this page