Time zones and broker time
Why broker time isn't UTC, how Tickwire labels it, and how to get day boundaries right.
MetaTrader servers keep their own clock, usually UTC+2 in winter and UTC+3 in summer (“New York close” time), but not always. Tick, bar and deal times from the terminal are in that broker-local time. Treating them as UTC shifts everything by two or three hours and puts daily limits on the wrong day.
The rules we follow
- On the account routes (
/users/current/...), fields namedtime(or ending inTimewithoutbroker) are UTC, ISO-8601 withZ. The terminal routes differ; see below. - Fields named
brokerTimeare broker-local, formattedYYYY-MM-DD HH:mm:ss.SSS, with no zone suffix because they’re not UTC. - We never put a
Zon broker time.
{ "time": "2026-09-23T11:02:11.480Z", "brokerTime": "2026-09-23 14:02:11.480" }
Finding a broker’s offset
curl -s https://api.tickwire.io/users/current/accounts/acc_7Qx/server-time -H "auth-token: $TW_KEY"
{
"time": "2026-09-23T11:02:13.000Z",
"brokerTime": "2026-09-23 14:02:13.000",
"brokerUtcOffsetMinutes": 180,
"brokerTimezone": "EET",
"brokerDSTSwitchTimezone": "America/New_York",
"dstRule": "us",
"offsetSource": "live",
"confidence": "high"
}
brokerUtcOffsetMinutes is broker time minus UTC, in minutes. It is measured, not guessed.
offsetSource says where it came from:
override: thebrokerTimezoneyou set on a provisioning profile.terminal: the terminal’s own statement of its offset.live: measured from fresh ticks. On MT5 it is rounded to 30 minutes, on MT4 to 15 minutes. A stale tick never counts.detected: predicted by the daylight-saving rule we detected.stored: the last value stored for that server, used after a weekend restart.live_provisional: from fresh ticks, before three samples agree.unknown: no offset yet.
The daylight-saving rule is worked out from the hour at which trading weeks open over several
years of hourly bars. Until we know the offset, brokerUtcOffsetMinutes is null. We never fill
it in with a guess.
The account snapshot (GET /users/current/accounts/{id}/snapshot)
carries the same clock in its server_time section, with the offset stated explicitly as
brokerUtcOffsetMinutes (null when not yet measured, never assumed to be 0).
If auto-detection gets a broker wrong, set brokerTimezone and brokerDSTSwitchTimezone on a
provisioning profile.
Terminal routes (/mt4/{id}/... and /mt5/{id}/...)
The terminal routes follow the terminal’s own habit. By default their times are the broker’s wall
clock, ISO-8601 with milliseconds and no Z:
{ "symbol": "EURUSD", "bid": 1.10012, "ask": 1.10014,
"time": "2026-09-23T14:02:11.480", "brokerTime": "2026-09-23 14:02:11.480" }
To get real UTC, add ?timeBasis=utc or send the header X-Tickwire-Time-Basis: utc. Those times
end in Z. If the offset is not known yet, the request fails with 503 broker_offset_unknown. We
never send a broker time with a Z on it.
Every answer says which basis it used:
X-Tickwire-Time-Basis:brokerorutc.X-Tickwire-Broker-Utc-Offset-Seconds: broker time minus UTC, in seconds, orunknown.
getQuote always adds brokerTime in the YYYY-MM-DD HH:mm:ss.SSS form, whatever the basis.
GET /mt5/{id}/ServerTimezone (and the MT4 one) gives serverTime, utcOffsetSeconds and
utcOffsetSource. It reads the same broker clock as server-time above, so
utcOffsetSeconds is brokerUtcOffsetMinutes times 60, and utcOffsetSource matches
offsetSource (it can be live_provisional too). When no source can tell, it answers 503
broker_offset_unknown. It never guesses 0.
To turn a broker-basis time into UTC: utc = time - utcOffsetSeconds.
Health fields
The health checks use the same two forms. Our own times, such as checked_at
and last_price_at, are UTC with milliseconds and a Z. Broker clock stamps, such as
last_price_broker_time, use YYYY-MM-DD HH:mm:ss.SSS with no zone. The offset, when the
terminal reports one, is in broker_utc_offset_minutes (null when unknown).
Day boundaries for risk rules
Prop firms usually reset daily loss limits at the broker’s midnight, not UTC midnight. Use
brokerTime (or UTC plus the measured offset) to decide which trading day a deal belongs to. Our
risk guard does this for you.