Documentation

    millisecond

    Extract the millisecond component from a date or timestamp.

    Try an expression

    In Formula, enter the expression and set Output type to BIGINT.

    Expression

    millisecond(timestamp '2021-08-03 11:59:44.123456')

    Result

    44123

    To use your own data, replace the example values with column names. Keep format strings and other options as written.

    Arguments and types

    millisecond(ts)
    ts
    Date, Interval, Time, Timestamp
    Supported signatures (7)
    millisecond(ts: DATE) → BIGINT
    millisecond(ts: INTERVAL) → BIGINT
    millisecond(ts: TIME WITH TIME ZONE) → BIGINT
    millisecond(ts: TIME) → BIGINT
    millisecond(ts: TIMESTAMP WITH TIME ZONE) → BIGINT
    millisecond(ts: TIMESTAMP) → BIGINT
    millisecond(ts: TIME_NS) → BIGINT

    The 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.

    Browse dates & timesDuckDB documentation

    Function metadata from DuckDB, used under the MIT license.