---
title: "CLOCK_OFFSET_LAST"
description: "The CLOCK_OFFSET_LAST SQL function gets the number of milliseconds the system clock of the device where Invantive UniversalSQL runs was ahead of the clock\u2026"
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/clock-offset-last
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/clock-offset-last
updated: 2026-08-09T00:00:00Z
license: https://documentation.invantive.eu/en/
---

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

## Purpose
The `CLOCK_OFFSET_LAST` SQL function gets the number of milliseconds the system clock of the device where Invantive UniversalSQL runs was ahead of the clock on the Internet at the last measurement, as measured on the messages exchanged with the Invantive Cloud. The number is negative when the system clock was behind. The function can be used without parentheses.

See also [[CLOCK_OFFSET_AVG]], [[NOW]] and [[UTC]].

Returns: the last measured offset of the system clock in milliseconds as a number.

## Examples
The following example retrieves the last measured offset of the system clock in milliseconds; the actual value differs per device and invocation:
```sql
select clock_offset_last

-------------------
118
```