A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/en/sql-reference/functions/try_to_time below:

Website Navigation


TRY_TO_TIME | Snowflake Documentation

Categories:

Conversion functions

TRY_TO_TIME

A special version of TO_TIME , TIME that performs the same operation (i.e. converts an input expression into a time), but with error-handling support (i.e. if the conversion cannot be performed, it returns a NULL value instead of raising an error).

For more information, see Error-handling conversion functions.

See also:

TO_TIME , TIME

Syntax
TRY_TO_TIME( <string_expr> [, <format> ] )
TRY_TO_TIME( '<integer>' )

Copy

Arguments

Required:

One of:

string_expr

A string that can be converted to a valid time.

'integer'

An expression that evaluates to a string containing an integer, for example '15000000'. Depending on the magnitude of the string, it can be interpreted as seconds, milliseconds, microseconds, or nanoseconds. For details, see the Usage Notes.

Optional:

format

Format specifier for string_expr or AUTO. For more information, see Date and time formats in conversion functions.

The default is the current value of the TIME_INPUT_FORMAT session parameter (default AUTO).

Returns

The data type of the returned value is TIME.

Usage notes Examples

This example uses TRY_TO_TIME:

SELECT TRY_TO_TIME('12:30:00'), TRY_TO_TIME('Invalid');

Copy

+-------------------------+------------------------+
| TRY_TO_TIME('12:30:00') | TRY_TO_TIME('INVALID') |
|-------------------------+------------------------|
| 12:30:00                | NULL                   |
+-------------------------+------------------------+

See TO_TIME , TIME for examples that convert an input expression to a time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4