See the examples on https://www.mql5.com/en/code/48419
Example: "Convert the current local time in all timezones to the broker time"
Hi
You can also get GMT time – so you can calculate new York time from GMT time. Something like:
datetime nyTime = TimeGMT() – 4*3600; //gmt time minus 4 hours
Best Regards
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
how can one get the same, actual New York-time all year long, no matter whether it's summer- or winter-time there?
How can this be achieved with MQL5 if one doesn't live in the New York-time zone themselves? Something like the missing TimeNewYork()-function?
Because MQL5 only provides our respective local time and our respective MT5-server time. The problem is that the time difference to New York (of both those time zones) are variable, because New York has a longer summer time than the others. So for three weeks per year, the time difference deviates fom the norm, it's variable and I have no clue how to calculate it with the MQL5 built-in tools (or anything else that also works in the Strategy Tester).
Any ideas?