Server time, local time, UTC: getting EA time filters right
Posted: Mon Nov 02, 2026 11:14 am
Time filters in EAs are a common source of bugs. "Trade only between 08:00 and 11:00 London" sounds simple until clocks change.
The three clocks:
A test: run the EA's time filter function for dates in March, April, October and November, and print the London time it calculates.
How do you handle time zones in your EAs?
The three clocks:
- Server time: the broker's time, often GMT+2 or GMT+3 to align daily candles with New York close.
- Local time: the VPS or PC clock.
- UTC: the reference everything can be converted to.
- Brokers change server time for daylight saving, usually on the US schedule.
- London changes on a different date from New York, so during the daylight-saving mismatch weeks the offset between them changes.
- Hard-coded server hours break twice a year.
A test: run the EA's time filter function for dates in March, April, October and November, and print the London time it calculates.
How do you handle time zones in your EAs?