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.002 │ 00:00:00 │ -0:00:00.002 │
└────────────────────────────────────────────────────────────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today