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

ParameterTypeRequiredDescription
intervalINTERVALYesAn 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

Examples

Last update at: 2025/10/13 10:23:46