ROUND_MILLISECONDS_UDF (TIMESTAMP_TZ)

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

This user-defined function (UDF) is a function that rounds milliseconds to increments of 0, 3, or 7 milliseconds. Transact automatically rounds the milliseconds of datetime values.

ROUND_MILLISECONDS_UDF(INPUT TIMESTAMP_TZ)

Parameters

INPUT TIMESTAMP_TZ

The input time to be rounded.

Returns

Returns the same input TIMESTAMP_TZ value but with the milliseconds rounded.

Usage example

Input:

SELECT PUBLIC.ROUND_MILLISECONDS_UDF('1900-01-01 00:00:00.995 +0100')

Output:

'1900-01-01 00:00:00.997 +0100'

Last updated