CAST_DATE_UDF

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Definition

The function processes a timestamp in string format to a date. It returns a date with the specified format.

PUBLIC.CAST_DATE_UDF(DATESTR STRING)

Parameters

DATESTR STRING

The date as a string to be formatted. The format should be 'YYYY-MM-DD"T"HH24:MI:SS.FF' e.g. '2024-01-25T23:25:11.120'.

Please review the following information about formatting here.

Returns

Returns a date with the new format applied.

Usage example

Input:

SELECT PUBLIC.CAST_DATE_UDF('2024-01-25T23:25:11.120');

Output:

2024-01-25

Last updated