How to add or subtract days or minutes from a MQL5 Time Structure ?
chandra100:
How to add or subtract days or minutes from a MQL5 Time Structure ?
Convert to seconds then add or subtract . . . do you understand what a datetime type variable is ? look it up.
How to add or subtract days or minutes from a MQL5 Time Structure ?
RaptorUK:
Convert to seconds then add or subtract . . . do you understand what a datetime type variable is ? look it up.
Convert to seconds then add or subtract . . . do you understand what a datetime type variable is ? look it up.
I dont think ur idea will work.
chandra100:
Maybe I misunderstood your question then, why will it not work ?
I dont think ur idea will work.
,RaptorUK:
Maybe I misunderstood your question then, why will it not work ?
Maybe I misunderstood your question then, why will it not work ?
Assume the present date is Feb 28 and time is 23:00.
If I like to add 2 hours, it has to change all the three of hour part , day part and month part of datetime strucrure.
Leap year factor should also be taken into account.
converting into seconds won't do any purpose.
chandra100:
OK, I did understand your question correctly, if you have Feb 28th 23:00 saved in a datetime variable and you want to add 2 hours all you do is add 2 * 60 * 60 to the variable. You don't need to be concerned with leap years. when you use TimeToString() with this variable and Print() it you will see the correct date and time . . .
Assume the present date is Feb 28 and time is 23:00.
If I like to add 2 hours, it has to change all the three of hour part , day part and month part of datetime strucrure.
Leap year factor should also be taken into account.
converting into seconds won't do any purpose.
See this article.
That was fine.
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