Documentation

    try_strptime

    Parse text into a timestamp using a format string such as %d/%m/%Y. Text that doesn't match returns a missing value instead of an error.

    Try an expression

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

    Expression

    try_strptime('20/09/1992', '%d/%m/%Y')

    Result

    1992-09-20 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

    try_strptime(text, format)
    text
    Text
    format
    Text, List
    Supported signatures (2)
    try_strptime(text: VARCHAR, format: VARCHAR) → TIMESTAMP
    try_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.