TIME

The TIME function returns a time from a value.

Syntax

TIME ( expression )

Splice Machine displays TIME and TIMESTAMP values using the current time zone for the server to which you are connected. DATE values, however, are stored as fixed strings, and are not affected by the time zone of the server to which you are connected.

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