LOCALTIME

Returns the current time (as a TIME) when the query executes as defined by the computer on which the SQLstream s-Server is running.

LOCALTIME is always returned using the timezone in which s-Server is running. This is explicitly set to UTC, rather than the default timezone for the server.

SQLstream recommends that as far as possible all times used should be treated as UTC - this avoids problems with handling summer time and especially the repeating hour (in local times - for example 01:00 to 02:00) when clocks go back in fall (autumn).

Like all the standard SQL date/time functions, this function returns the same value - the time when the query started (actually, when the first row is processed) - for every row processed. A streaming query may run for minutes, hours, days or even years; if you want to return the latest time when each row is processed you should instead use:

    SELECT ..., CAST(CURRENT_ROW_TIMESTAMP AS TIME) AS current_date, ... FROM ...

See also:

Example

0: jdbc:sqlstream:> VALUES localtime;
+-----------+
| LOCALTIME |
+-----------+
| 14:57:56  |
+-----------+

Limitations

SQLstream does not support the optional parameter specified in the SQL standard. This is a departure from the SQL standard.