Documentation

    strptime

    Parse text into a timestamp using a format string such as %d/%m/%Y. Text that doesn't match raises an error; use try_strptime to get a missing value instead.

    Try an expression

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

    Expression

    strptime('15/03/2024', '%d/%m/%Y')

    Result

    2024-03-15 00:00:00

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

    Arguments and types

    strptime(text, format_list)
    text
    Text
    format
    Text
    format_list
    List
    Supported signatures (2)
    strptime(text: VARCHAR, format-list: VARCHAR[]) → TIMESTAMP
    strptime(text: VARCHAR, format: VARCHAR) → TIMESTAMP

    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.