day

datetime

Extracts the day of the month from a date or timestamp

Syntax

day(date)

Parameters

date (date|timestamp)

The date value to extract the day from

Returns

number

The day of the month (1-31)

Examples

Input:
day("2024-03-15")
Output:
15
Get the current day
Input:
day(now())
Output:
25
Extract day from a date field
Input:
.date | day
Output:
1

The day() function extracts the day of the month component from a date or timestamp value, returning a number from 1 to 31.

Usage

Use day() to filter records by specific days of the month or extract the day component for date-based calculations and analysis.