invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

LOCALTIME

Syntax

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> LOCALTIME[LOCALTIME]:::quoted
    LOCALTIME --> End((END))

Purpose

The LOCALTIME SQL function returns the current time of day in local time at the device where Invantive UniversalSQL runs, as a time without a date, in whole seconds. It is written without parentheses, as the SQL standard writes it. Within one SQL statement every occurrence returns the same time, taken from the same moment as described in NOW.

See also NOW and CURRENT_DATE.

Returns: current time of day as time.

Examples

The following example checks whether the current local time lies before noon; the actual value differs per invocation:

select case when localtime < time '12:00:00' then 'morning' else 'afternoon' end

-------
morning