TIME

The TIME function returns a time from a value.

Syntax

TIME ( expression )

expression

An expression that can be any of the following:

  • A  TIMESTAMP value
  • A valid string representation of a time or timestamp

Results

The returned result is governed by the following rules:

  • If the argument can be NULL, the result can be NULL; if the argument is NULL, the result is the NULLvalue.
  • If the argument is a time, the result is that time value.
  • If the argument is a timestamp, the result is the time part of the timestamp.
  • If the argument is a string, the result is the time represented by the string.

Syntax

TIME ( expression )

Example

splice> VALUES TIME( CURRENT_TIMESTAMP );
1
--------
18:53:13

1 row selected

See Also