---
title: "LOCALTIME"
description: "LOCALTIME SQL\u95A2\u6570\u306F\u3001Invantive UniversalSQL\u304C\u5B9F\u884C\u3055\u308C\u308B\u30C7\u30D0\u30A4\u30B9\u306E\u30ED\u30FC\u30AB\u30EB\u6642\u523B\u306B\u304A\u3051\u308B\u73FE\u5728\u306E\u6642\u523B\u3092\u3001\u79D2\u5358\u4F4D\u3067\u8FD4\u3057\u307E\u3059\u3002"
language: ja
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ja/docs/invantive-universalsql/grammar/sql-functions/localtime
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/localtime
updated: 2026-12-04T13:55:27Z
license: https://documentation.invantive.eu/ja/
---

## 構文
```mermaid
%%{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))
```

## 目的
`LOCALTIME` 関数は、Invantive UniversalSQL が実行されるデバイスのローカル時刻における現在の時刻を、日付のない時刻として秒単位で返します。 SQL標準の書き方に従い、括弧を付けずに記述します。 1つのSQL文内では、すべての出現が同じ時刻を返し、その時刻は[[NOW]]で説明されているものと同じ瞬間から取得されます。

関連項目：[[NOW]]および[[CURRENT_DATE]]。

戻り値: `time` としての現在の時刻。

## 例
次の例では、現在のローカル時刻が正午より前かどうかを確認します。実際の値は呼び出しごとに異なります:
```sql
select case when localtime < time '12:00:00' then 'morning' else 'afternoon' end

-------
morning
```

