How to get difference between two datetime variables? Suppose Start time is datetime Time1=2013.12.31 22:53 and End time is datetime Time2=2014.01.02 00:14 . When I subtract from Time2 Time1 this way: Time=Time2-Time1 then result Time is 91260 or 01:21. Really that difference is 21 minutes. It seems that MQL5 has a bug. Why it founds result one hour more? Is there possible to use some other special operators instead of + or -?
- MACD - Oscillators - Technical Indicators - Price Charts, Technical and Fundamental Analysis
- MACD - Oscillators - Indicators - Charts - MetaTrader 5 for Android
- MACD - Oscillators - Indicators - Chart - MetaTrader 5 for iPhone
Hi, I think your calculation is wrong. Why the difference is 21 minutes? if the difference is 21 minutes so the Time2 should be 23:14
Seems you are right, biantoro kunarto, when I calculate that again indeed time is 01.21. Probably I worked on that too much, sorry. And thank you!
you're welcome
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