📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

TO_DAYS



Converts a specified number of days into an Interval type.

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

Syntax

TO_DAYS(<days>)

Return Type

Interval (represented in days).

Examples

SELECT TO_DAYS(2), TO_DAYS(0), TO_DAYS(-2); ┌────────────────────────────────────────┐ │ to_days(2) │ to_days(0) │ to_days(- 2) │ ├────────────┼────────────┼──────────────┤ │ 2 days │ 00:00:00-2 days │ └────────────────────────────────────────┘

Was this page helpful?