<!-- Source: @site/projects/sqlens-for-laravel/docs/rules/my-l6-time-zone-not-utc.md -->
<!-- Canonical: https://docs.pushery.com/sqlens-for-laravel/rules/my-l6-time-zone-not-utc/ -->

# MY.L6.TIME_ZONE_NOT_UTC — a server whose clock is the host's, not a decision

> A MySQL server on time_zone = SYSTEM converts timestamps using the host's zone, so the same schema behaves differently on a different machine.

- **Category:** idiom
- **Level:** 6
- **Confidence:** deterministic
- **Downtime class:** none
- **Stability:** stable
- **Suites:** audit
- **Applies to:** MySQL 8.4
- **Not transferable to MariaDB:** this page describes MySQL 8.4 behavior. MariaDB answers the
  same driver and does not share these semantics, so SQLens refuses it outright rather than
  reasoning about it — see [drivers/unsupported](https://docs.pushery.com/sqlens-for-laravel/drivers/unsupported.md).

MySQL ships with `time_zone = SYSTEM`, which means *whatever the host's clock is set to*. The
database's behavior is then a property of the machine it happens to run on.

Measured on a real MySQL 8.4 running `SYSTEM`:

```sql
SELECT CONVERT_TZ('2026-01-01 14:00:00', 'SYSTEM', '+00:00');
-- 2026-01-01 13:00:00
```

The server silently used the host's offset. Nothing raised, nothing warned, and the answer is only
correct if the host is configured the way whoever wrote the query assumed. Move the server to a
differently-configured machine, or re-image the one it is on, and the same schema converts
differently — with nothing in the database changed.

## Why `SYSTEM` is worse than a wrong zone

The other values at least **name** a zone, so two servers configured alike behave alike. `SYSTEM`
names nothing. It is not a setting so much as a deferral, and what it defers to is outside the
database entirely.

## Prefer the offset form

`+00:00` works on every MySQL. The named spellings — `UTC`, `Etc/UTC` — need the **timezone tables**
loaded into the `mysql` schema, and a fresh install has none.

On the same server, with `mysql.time_zone_name` empty:

```sql
SELECT CONVERT_TZ('2026-01-01 14:00:00', 'UTC', '+00:00');
-- NULL
```

A rule that demanded the named spelling would push projects toward a configuration that silently
produces `NULL` on their server. So all three spellings are accepted.

## Flagged

```sql
SET GLOBAL time_zone = 'SYSTEM';
```

## Preferred

```sql
SET GLOBAL time_zone = '+00:00';
```

## What is not accepted

`GMT`, `Etc/GMT`, `Universal` and `Zulu` resolve to the same instant and are deliberately **not**
accepted — the same argument the PostgreSQL rule makes. They are the same offset but a different
statement of intent, and the next person to touch a server set to `GMT` may well "correct" it to a
local zone.

## What is read, and what is not

Only the **server's** value. Laravel sets the session timezone from the connection config on every
connection it opens, so a session running something else is the framework's choice and not a
statement about the server.

A value the server withholds is reported as **undetermined** with a reason, never as a pass.

## Sources

- [MySQL Server time zone support](https://dev.mysql.com/doc/refman/8.4/en/time-zone-support.html) — MySQL 8.4
- [mysql_tzinfo_to_sql — load the time zone tables](https://dev.mysql.com/doc/refman/8.4/en/mysql-tzinfo-to-sql.html) — MySQL 8.4
- [Server system variables](https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html) — MySQL 8.4

<!-- BEGIN generated: remediation -->
## The fix material this rule carries

A finding from this rule carries a payload whose strategy is `none`: this rule has looked,
and there is no safe standard sequence. That is a conclusion rather than an omission — a
finding with no payload at all says only that nobody wrote one.

The payload is material for you or an agent to apply. SQLens writes no migration and runs no
DDL. See [the remediation payload](https://docs.pushery.com/sqlens-for-laravel/remediation-schema.md) for every field, the placeholder
semantics, and the version rules a consumer has to follow.
<!-- END generated: remediation -->
