Skip to content

Convert a date or date with time (timestamp/datetime) to a UInt8 number containing the number of the day of the month (1-31).

func.to_day_of_month(<expr>)
func.now(), func.to_day_of_month(func.now()), func.day(func.now())
┌──────────────────────────────────────────────────────────────────────────────────────┐
│ func.now() │ func.to_day_of_month(func.now()) │ func.day(func.now()) │
├────────────────────────────┼──────────────────────────────────┼──────────────────────┤
2024-03-14 23:35:41.9479621414
└──────────────────────────────────────────────────────────────────────────────────────┘
TO_DAY_OF_MONTH(<expr>)
ArgumentsDescription
<expr>date/timestamp

TINYINT

SELECT NOW(), TO_DAY_OF_MONTH(NOW()), DAY(NOW());
┌──────────────────────────────────────────────────────────────────┐
now() │ to_day_of_month(now()) │ day(now()) │
├────────────────────────────┼────────────────────────┼────────────┤
2024-03-14 23:35:41.9479621414
└──────────────────────────────────────────────────────────────────┘