- How to find the period
- How can i set an external datetime variable to the current time?
- Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6.
strontiumDog: , I want to update a variable with the current server time zone.
| datetime server = TimeCurrent(), gmt = TimeGMT(); int TZ = (int) MathRound( (gmt - server) / 3600.0 );This will not work in the tester, however. This may change on DST. |
Why? the server's time zone won't change.
strontiumDog: , I want to update a variable with the current server time zone. | This will not work in the tester, however. This may change on DST. |
Thanks for the suggestion WHRoeder.
The code returns the difference between GMT and the current, which is fine, and I can extrapolate from there, but I'm on GMT and BST, depending on the date. You're right, it may change on DST, but in my case it won't as the terminal is on the same time zone as the server. What I was really looking for was a string that instantiates to 'BST' or 'GMT' etc. or a value which is different today (Sep 9 uk, BST) to this time in 2 months (Nov 9, uk, GMT). Actually, I guess I could use UTC.
Replying with that is clearly unhelpful.
If you want an helpful answer, maybe you should think why people are helping others on a forum ?
Personally I am interested by Gumrai's question and your reaction doesn't encourage me to help you.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use