microsecond
Extract the microsecond component from a date or timestamp.
Try an expression
In Formula, enter the expression and set Output type to BIGINT.
Expression
microsecond(timestamp '2021-08-03 11:59:44.123456')Result
44123456To use your own data, replace the example values with column names. Keep format strings and other options as written.
Arguments and types
microsecond(ts)- ts
- Date, Interval, Time, Timestamp
Supported signatures (7)
microsecond(ts: DATE) → BIGINT
microsecond(ts: INTERVAL) → BIGINT
microsecond(ts: TIME WITH TIME ZONE) → BIGINT
microsecond(ts: TIME) → BIGINT
microsecond(ts: TIMESTAMP WITH TIME ZONE) → BIGINT
microsecond(ts: TIMESTAMP) → BIGINT
microsecond(ts: TIME_NS) → BIGINTThe result type can depend on the input types. See DuckDB for the full argument rules.
Things to know
If the first argument is missing, the result is NULL.
Function metadata from DuckDB, used under the MIT license.