To convert a time zone in SQL, convert the source wall-clock time to a UTC instant and then apply the destination zone’s offset at that instant.
The exact statement depends on your database: SQL Server and PostgreSQL use AT TIME ZONE, while MySQL uses CONVERT_TZ(). The value’s data type and meaning are just as important as the function name.

Start by identifying the time value
Time-zone conversion only works correctly when SQL knows what the original value represents. An instant, a local wall-clock time, and a fixed UTC offset behave differently.
- Instant: One exact moment in time. It is independent of the viewer’s location and should be stored in UTC or an equivalent instant-aware type.
- Wall-clock time: A date and clock reading without enough information to identify its UTC instant. The source time zone is required.
- Fixed offset: An instant paired with a numeric offset such as UTC-04:00. The offset preserves the recorded instant but does not encode future daylight-saving changes.
| SQL value | Meaning | Conversion approach |
|---|---|---|
| PostgreSQL timestamptz or MySQL TIMESTAMP | An exact instant | Store the instant and change the session or query time zone for display. |
| PostgreSQL timestamp without time zone, MySQL DATETIME, or SQL Server datetime2 | A local date and clock reading | Supply the source zone explicitly before calculating a target time. |
| SQL Server datetimeoffset | An instant plus a numeric offset | Preserve the offset, but add a named zone when the result must follow that zone’s DST rules. |
For a one-time event, such as a meeting or transaction, UTC storage usually gives the clearest behavior. For a recurring local schedule, such as a recurring New York appointment, store the local rule and zone rather than freezing today’s offset.
Convert a time zone in SQL step by step
- Classify the source value. Confirm whether it is an instant, a wall-clock reading, or a wall-clock reading with a fixed offset. If it is a local reading, identify the source zone before doing any arithmetic.
- Use the identifier expected by the database. SQL Server uses Windows names such as Eastern Standard Time. PostgreSQL uses IANA names such as America/New_York. MySQL also accepts named zones such as America/New_York when its time-zone tables are available.
- Turn a source wall-clock time into an instant. PostgreSQL uses event_local AT TIME ZONE 'America/New_York'. SQL Server uses event_local AT TIME ZONE 'Eastern Standard Time' AT TIME ZONE 'UTC'. MySQL uses CONVERT_TZ(event_local, 'America/New_York', 'UTC').
- Render that instant in the destination zone. In PostgreSQL, use event_instant AT TIME ZONE 'Europe/Paris'. In SQL Server, make the UTC step explicit and then apply the target Windows zone. In MySQL, use CONVERT_TZ() or set the session time zone for an instant-aware column.
- Set the session zone deliberately. An unset or inherited session zone can change displayed values between tools or connections. Standardize the session when producing reports, exports, or application results.
- Test both ordinary dates and DST boundaries. Confirm the source date, target date, UTC offset, and weekday. A conversion can be numerically plausible yet still land on the wrong calendar day.
SQL Server: use AT TIME ZONE with Windows names
SQL Server 2016 and later supports AT TIME ZONE. It expects Windows time-zone names, so use Eastern Standard Time rather than the IANA identifier America/New_York. The word “Standard” remains part of the identifier even when daylight time is active.
For a datetime2 value containing a local reading in the source zone, interpret it in that zone and convert the resulting instant to UTC:
SELECT event_local AT TIME ZONE 'Eastern Standard Time' AT TIME ZONE 'UTC' AS event_utc;
To display an instant already known to be in UTC in a destination zone, make the UTC interpretation explicit:
SELECT event_utc AT TIME ZONE 'UTC' AT TIME ZONE 'Pacific Standard Time' AS event_pacific;
The first AT TIME ZONE operation establishes the source or UTC interpretation; the next operation renders the resulting instant in the target zone.
Worked example: Suppose event_local contains a New York clock reading of 09:00 on July 15, 2025, and event_utc must be stored in UTC.
SELECT CAST('2025-07-15 09:00:00' AS datetime2) AT TIME ZONE 'Eastern Standard Time' AT TIME ZONE 'UTC' AS event_utc;
New York is on UTC-04:00 on that date, so 09:00 − (−04:00) = 13:00 UTC. The result is 2025-07-15 13:00:00 +00:00.
PostgreSQL: separate instants from wall-clock values
PostgreSQL’s AT TIME ZONE behavior depends on the input type. With a timestamp without time zone, it interprets the reading in the named source zone and returns a timestamptz:
SELECT event_local AT TIME ZONE 'America/New_York' AS event_instant;
With a timestamptz, it renders the stored instant in the requested target zone and returns a timestamp without time zone:
SELECT event_instant AT TIME ZONE 'Europe/Paris' AS event_paris;
You can also change how timestamptz values are displayed for the current session:
SET TIME ZONE 'America/New_York';
This setting changes presentation, not the stored instant. Use SET LOCAL TIME ZONE when a transaction-scoped setting is safer. IANA names allow PostgreSQL to apply the correct seasonal offset for the selected date.
MySQL: use CONVERT_TZ with named zones
MySQL converts a value with CONVERT_TZ(value, source_zone, target_zone). Named zones depend on MySQL’s time-zone tables being loaded; without them, CONVERT_TZ() may return NULL for a named zone.
To convert a local reading to UTC and display the result in UTC:
SET time_zone = 'UTC'; SELECT CONVERT_TZ(event_local, 'America/New_York', 'UTC') AS event_utc;
MySQL stores TIMESTAMP values as instants and converts them for display according to time_zone. A DATETIME does not receive that automatic treatment, so it should be passed through CONVERT_TZ() when a source zone is known. Fixed offsets can be used when named-zone data is unavailable, but they do not adjust automatically for daylight saving time.
Store the right value for events and schedules
Choose the storage model based on what the time represents:
- One-time event: Store the confirmed instant in UTC, or in the database’s instant-aware type, and convert it to a named zone when reporting.
- Recurring local schedule: Store the local clock rule and its zone identifier, then derive the UTC instant for each occurrence. A fixed offset can become wrong when DST rules change.
- Offset supplied by a source: Preserve that offset when the instant matters, but do not treat it as a complete time-zone rule.
Conversion and formatting are separate operations. After converting the instant, How to Convert Date Format in SQL: CONVERT, CAST, FORMAT explains how to control its displayed text representation.
Check expected results with the Time Zone Converter
Use the Time Zone Converter to establish the expected local time, date, weekday, and UTC offset before testing a SQL query:
- Enter the date and time exactly as it appears on a clock in the source zone.
- Choose that location under From zone.
- Add one or more target zones from the available chips.
- Read each target’s converted local time, calendar date, weekday, and UTC offset. For a live comparison, select Use current time instead.
The converter is DST-aware and uses the browser’s IANA time-zone data. It supports roughly thirty major IANA zones and converts one date and time at a time. It does not execute SQL, transform a result set, or replace the database’s own named-zone rules; use it as an expected-value check and then compare that result with your query. The calculation runs locally in the browser, so the selected date and zone choices are not uploaded.
Prevent common SQL time-zone errors
- Applying a target zone to a naive value without a source. A wall-clock time has no unique instant until its source zone is supplied.
- Using a fixed offset as a substitute for a named zone. The offset may be correct today but fail to follow seasonal changes.
- Assuming every session uses the same zone. Set the session or query zone explicitly for reporting and exports.
- Mixing the two PostgreSQL AT TIME ZONE behaviors. A timestamp without time zone is interpreted in a zone; a timestamptz is rendered in one.
- Forgetting that a conversion can change the date. Check the target calendar date and weekday, not only the hour.
- Skipping transition dates. During a spring-forward or fall-back transition, a local clock reading can be absent or repeated. Decide how your application handles those cases and validate them with named-zone rules.
The reliable pattern is consistent across databases: identify the value, interpret the source wall-clock time in a named zone, obtain one UTC instant, and render that instant in the destination zone.