Skip to content

Converts a specified number of days into an Interval type.

  • Accepts positive integers, zero, and negative integers as input.
func.to_days(<days>)
func.to_days(2)
┌──────────────────────────────────────────────────────┐
│ func.to_days(2) │
├──────────────────────────────────────────────────────┤
200 days │
└──────────────────────────────────────────────────────┘
TO_DAYS(<days>)

Interval (represented in days).

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