Skip to main content

TO_MILLISECONDS

Introduced or updated: v1.2.677

Converts a specified number of milliseconds into an Interval type.

  • Accepts positive integers, zero, and negative integers as input.

Syntax

TO_MILLISECONDS(<milliseconds>)

Return Type

Interval (in the format hh:mm:ss.sss).

Examples

SELECT TO_MILLISECONDS(2), TO_MILLISECONDS(0), TO_MILLISECONDS((- 2));

┌────────────────────────────────────────────────────────────────┐
│ to_milliseconds(2) │ to_milliseconds(0) │ to_milliseconds(- 2)
├────────────────────┼────────────────────┼──────────────────────┤
0:00:00.00200:00:00-0:00:00.002
└────────────────────────────────────────────────────────────────┘
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today