TO_MILLISECONDS
All functions > DATE_AND_TIME > TO_MILLISECONDS
Returns the truncated number of milliseconds in the given interval.
Syntax
TO_MILLISECONDS(interval)
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
interval | INTERVAL | Yes | An INTERVAL value to convert |
Returns
The total number of milliseconds as BIGINT
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