Skip to main content

_date(col, format)

Parses or formats a timestamp column.

Syntax

column._date(format)

The format string follows Go's reference layout — based on the date Mon Jan 2 15:04:05 MST 2006.

TokenMeaning
20064-digit year
012-digit month
022-digit day
152-digit hour (24h)
042-digit minute
052-digit second

Examples

mydb.events{
id,
time._date("2006-01-02")
}

Returns each event's date as "2026-04-12".

Used in a filter

mydb.events[time._date("2006-01-02") = "2026-04-12"]

All events from a single day.

Notes

  • The column must be a timestamp or a numeric epoch value.
  • For more complex date math (last 7 days, this month), filter on raw timestamps and let your client format them.