MetaTrader5 Python API timestamp semantics: UTC or broker server time?

 

Hello, I am investigating timestamp semantics in the official MetaTrader5 Python package. I have reproduced the following behavior on two independent MT5 brokers: - xChief-MT5, build 6230 - Alpari-MT5-Demo, build 6231 For fresh EURUSD ticks, repeated paired captures show: - Python `symbol_info_tick().time` closely tracks MQL5 `TimeCurrent()` - `TimeCurrent() - TimeGMT()` is approximately +10,800 seconds - therefore the raw Python tick timestamp appears to follow the broker trading-server clock (currently UTC+3), not UTC However, the official Python documentation states that MT5 tick/bar times are UTC. I need authoritative clarification on these exact points: 1. `symbol_info_tick().time` and `.time_msc` - Are the returned integer values Unix epoch UTC? - Or do they encode the broker/trading-server clock? 2. `copy_rates_from_pos(...)[“time”]` - Is the returned candle open time UTC? - Or broker server time? 3. `copy_ticks_range(utc_from, utc_to, ...)` - Must the input datetime arguments be UTC? - What time basis do the returned `time` / `time_msc` fields use? 4. Historical / DST semantics - If a broker uses UTC+2 in winter and UTC+3 in summer, how are historical tick and bar timestamps encoded across the seasonal transition? - Is there any API field or metadata that provides the applicable server UTC offset for an event? I do not want to manually subtract 3 hours based only on observed behavior. Is there an official MetaQuotes specification for these returned timestamp fields, especially when broker server time differs from UTC? Thank you.

 
 
The Python API
time
and
time_msc
fields are Unix timestamps in UTC, not broker local time, so don't subtract the server offset yourself. For
copy_ticks_range()
and
copy_rates_*()
, pass timezone-aware UTC datetimes, like
datetime(..., tzinfo=timezone.utc)
. Naive datetimes can get read as Python's local timezone. The API doesn't give you a historical broker UTC-offset series, so session labels need their own mapping.