MT4 and MT5 Server Time vs Local Time vs UTC: How to Check Your Offset and Why It Matters for EAs and Backtests

MetaTrader works in your broker's trade server time, which is usually not the time on your computer's clock. In MT5 the chart's time axis uses it, and both MT4 and MT5 show it in the Market Watch window. The difference between that clock and UTC is something you can measure yourself in a few minutes. If you run an Expert Advisor (EA) with time-based rules, or compare a backtest with live results, that difference decides which hour of the day your rules actually fire.

This article covers the desktop versions of MetaTrader 4 (MT4) and MetaTrader 5 (MT5). It is based on the MetaQuotes documentation and the sources listed at the end, checked on 2026-10-17. Menu names and labels can differ between builds and languages, so confirm each step on your own terminal. It does not name any broker or give a broker's offset, because a server's time setting belongs to that server and can change.

Quick answer

  1. There are three clocks. The server clock (what Market Watch and, in MT5, the chart show), your computer's local clock, and UTC. MetaTrader's TimeGMT() is calculated from your computer's clock, not read from the server.
  2. Read the server time from the title of the Market Watch window, from the Time column in the MT5 Market Watch, or from the time axis of the chart.
  3. Measure the offset on a weekday, while quotes are updating: write down the server time and a reliable UTC clock at the same moment, and subtract. Do not measure on a weekend, when the server clock stands still.
  4. The offset can change during the year. If the server follows a daylight saving schedule, its offset from UTC moves on the dates of that schedule. MQL4 and MQL5 give you no function that reports the server's daylight saving status.
  5. In the Strategy Tester, the GMT value equals the simulated server time. An EA that works out the server offset by comparing the two will get zero there.

1. The three clocks

Clock Where it comes from Where you meet it What it depends on
Server time The broker's trade server. The terminal learns it from incoming quotes Market Watch, MT5 chart time axis, TimeCurrent() The server. Not your computer's settings
Local time Your computer's clock and time zone TimeLocal() Your computer's settings, including daylight saving
UTC (GMT) Calculated by the terminal from your computer's local time TimeGMT(), TimeGMTOffset() Your computer's clock and time zone

Three details are easy to miss.

  • TimeCurrent() is the server time. The MQL5 reference describes it as the time of the last quote received, formed on the trade server, and independent of the time settings on your computer. Changing your computer's time zone does not move it.
  • TimeGMT() is not read from the server. The reference says it is the GMT calculated, with the daylight saving switch taken into account, from the local time of the computer where the terminal runs. If your computer's clock or time zone is wrong, TimeGMT() is wrong by the same amount.
  • TimeTradeServer() (MQL5 only) is an estimate. It is calculated in the terminal and depends on your computer's settings, unlike TimeCurrent().

The sign convention is a trap for anyone who writes or reads EA code. TimeGMTOffset() is defined as TimeGMT() - TimeLocal(): the difference between GMT and your computer's local time, not the server's. For a computer at UTC+2 it returns -7200 seconds, the opposite sign to the usual "UTC+2" notation.

2. Where to read the server time

  • Market Watch title. The MQL reference describes the time of the last quote receipt as "the time shown in the title" of the Market Watch window. This is usually the quickest place to look.
  • Market Watch Time column (MT5). The MT5 help describes the Time column as the last quote arrival time, specified according to the time zone of the broker's trading server. The displayed columns can be configured from the Market Watch context menu.
  • Chart time axis. In MT5, the time on the horizontal axis of every chart corresponds to the server time for the historical bars, and the rightmost bar holds the current TimeCurrent() value, according to the MQL5 Book.

The server clock only moves when quotes arrive. The terminal learns the updated server time from incoming ticks, so if no instrument in Market Watch is ticking, the displayed server time stands still. On a Sunday it will most likely show Friday evening. The exception is a server that offers continuously traded instruments such as cryptocurrencies, and even then the displayed time can lag behind your local clock in quiet periods.

3. Measure your server's offset from UTC

Do this on a weekday, while the symbols in Market Watch are trading and updating.

  1. Open the Market Watch window and read the server time in its title (or the Time column of a symbol that is ticking).
  2. At the same moment, read the current time from a reliable UTC clock.
  3. Subtract: offset = server time − UTC. A few seconds of difference is expected, because the displayed time is that of the last quote; look at the hours.
  4. Write the result as "UTC+N" or "UTC−N" together with the date and time you measured it. UTC+2 means the server clock reads two hours ahead of UTC.

Example (invented numbers for illustration): the Market Watch title reads 15:20 and the UTC clock reads 12:20. The server is three hours ahead of UTC, so the offset is UTC+3.

A single measurement describes only the moment you took it. Section 4 explains why you may need to repeat it.

4. Daylight saving can change the offset

Many countries move their clocks by an hour for part of the year, while UTC does not move. If a server's clock follows such a schedule, its offset from UTC changes on the dates of that schedule. Whether your server does, and which schedule it follows, is a setting of that server.

For comparison, here are two daylight saving schedules whose dates differ:

  • United States: begins at 2:00 a.m. on the second Sunday of March and ends at 2:00 a.m. on the first Sunday of November (NIST).
  • European Union: begins at 1:00 a.m. GMT on the last Sunday in March and ends at 1:00 a.m. GMT on the last Sunday in October, in every Member State (Directive 2000/84/EC, listed as in force on EUR-Lex on 2026-10-17).

Counting from these two rules, the United States schedule starts two to three weeks earlier in spring and ends one week later in autumn than the European one. A server that follows one of them will therefore change its offset on different dates from a server that follows the other. The rules give the pattern; the actual calendar dates move from year to year, so check the date for the year you care about.

MQL cannot tell you what your server does. The MQL5 Book states that determining the daylight saving time on a server is not as easy as for your own computer, and that MQL5 does not provide information about whether daylight saving is used at all and whether it is currently enabled. It shows an estimation method based on historical quotes, and notes that such methods can be wrong, for example for a server that runs on summer time all year round. For points like these it recommends asking the broker's support service.

A practical routine:

  • Measure the offset (section 3) once in winter and once in summer, or whenever clocks change in the country whose rules you suspect the server uses.
  • If two measurements differ by an hour, the server's offset changed in between. That may be a daylight saving schedule or a change to the server, and your broker's support can confirm which. Either way, an EA that assumes a fixed offset will be an hour off for part of the year.
  • If you cannot explain a reading, ask the broker's support which time zone the server uses and whether it changes with the seasons.

5. What this means for EAs and backtests

Time inputs. If an EA has inputs such as a start hour, an end hour or a GMT offset, find out in its documentation which clock they refer to: server time, GMT, or your computer's local time. The same number means a different moment on each clock. When the EA offers a manual offset field, enter the value you measured, and re-measure at clock changes.

TimeGMT() depends on your computer. In live trading it is calculated from your computer's clock and time zone (section 1). Comparing it with TimeCurrent() gives the server offset only if your computer's clock and time zone are right and the server clock is not frozen (section 2).

The Strategy Tester removes the difference. The MQL5 reference states that during testing, TimeGMT() is always equal to the simulated server time returned by TimeTradeServer(), and that TimeTradeServer() and TimeLocal() are in turn equal to the simulated TimeCurrent(). The MQL4 reference makes the same statement for TimeGMT() and TimeLocal() against TimeCurrent(). It follows that in the tester the GMT value and the server time are the same value. An EA that estimates the server offset as TimeGMT() minus TimeCurrent() therefore gets zero in the tester and the actual difference when it runs live. The documentation does not state the tester result for TimeGMTOffset() itself; the zero follows from its definition above.

Time is not the only reason a backtest and a live run can disagree, but it is cheap to rule out. If your results diverge around a particular hour, compare which offset the EA assumed in each run.

6. Keep a short record

Item Example entry
Date and time of the measurement (with your time zone) 2026-10-14, 15:20 server time, 12:20 UTC
Server offset UTC+3
Where you read the server time Market Watch title
Was the market open and quotes updating? Yes
Does the offset change with the seasons? Not yet known / confirmed by support on (date)
Offset the EA was set to, or assumed in the backtest UTC+3

The example row is invented to show the format; it is not any broker's setting.

FAQ

Why is the chart time different from my computer's clock? The chart shows the server's time, which comes from the broker's trade server, not from your computer. The two clocks only agree if the server happens to be in your time zone and on the same schedule.

If I change my computer's time zone, does the chart time change? Server time does not depend on your computer's settings. Values calculated from your computer's clock, such as TimeLocal() and TimeGMT(), do.

Why does the clock stand still on Sunday? The terminal learns the server time from quotes. When no instrument in Market Watch is ticking, the displayed server time does not advance.

Is the server offset the same all year? Not necessarily. If the server follows a daylight saving schedule, the offset changes with it. Measure it at different times of year and ask your broker's support if you need a definite answer.

Can I convert the chart time to my local time? Yes, by hand: UTC = server time − server offset, then add your own UTC offset for that date. Use the offset you measured for the date in question, not an offset from another season.

Sources

All pages were checked on 2026-10-17.

This article is general information about how MetaTrader terminals handle time. It is not investment advice and does not promise any trading result. Trading involves risk.

コメントを残す

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です

CAPTCHA