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
ParameterTypeRequiredDescription
intervalINTERVALYesAn 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 BIGINTf2 BIGINT
1000300000

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19