On this page
Kater SQL Functions Date grains
KATER__MILLISECOND
The start of the millisecond the timestamp is in.
Family: Date grains
Syntax
KATER__MILLISECOND(field)Arguments
| Argument | Description |
|---|---|
field | The timestamp, or a time of day. |
Returns
A timestamp.
Usage notes
- A date has no time of day, so the compiler refuses it on a date.
Example
This Sandbox query reads the sample shop’s orders. The table shows the rows that Kater gave.
SELECT orders.order_id AS "Order ID", orders.ordered_at AS "Ordered At", DIMENSION('ordered_at_millisecond', KATER__MILLISECOND(orders.ordered_at)) AS "Millisecond"FROM kater_dataset.orders AS ordersORDER BY 1LIMIT 3| Order ID | Ordered At | Millisecond |
|---|---|---|
| O00000 | 2025-05-26T09:02:00 | 2025-05-26T09:02:00 |
| O00001 | 2025-11-28T09:21:00 | 2025-11-28T09:21:00 |
| O00002 | 2025-07-25T13:56:00 | 2025-07-25T13:56:00 |
Compiles to
The call compiles to the same SQL on DuckDB and on Snowflake.
DATE_TRUNC('MILLISECOND', orders.ordered_at)See also
- Dates
- Other functions in Date grains:
KATER__DATE,KATER__WEEK,KATER__MONTH,KATER__QUARTER,KATER__YEAR,KATER__HOUR,KATER__MINUTE,KATER__SECOND