How can we obtain the GMT time of a datetime variable?
Try TimeTradeServer() instead of TimeCurrent(). TimeTradeServer is always ticking.
Jo Jomax:
When it's not sunday or a holiday that the broker clock is equal to timecurrent() we can obtain the GMT time of a datetime variable t:
t - ( timecurrent() - timeGMT() )
But is there a function that give us the value of timecurrent() - timeGMT() when a broker time isn't changing?
from my experience, when I have note that there is difference between the broker time and the actual time 3 Hours.When it's not sunday or a holiday that the broker clock is equal to timecurrent() we can obtain the GMT time of a datetime variable t:
t - ( timecurrent() - timeGMT() )
But is there a function that give us the value of timecurrent() - timeGMT() when a broker time isn't changing?
I used timeoffset,timecurrent,rawtime and adjustedtime in my prints to check and confirm the server time.
0
Jo Jomax: t - ( timecurrent() - timeGMT() )
That will not handle minor jitter of the clocks. int tzToGMT=0; void OnTick(){ tzToGMT=900*MathRound( ( TimeGMT() - TimeCurrent() )/900.); … ////// datetime gmt= t + tzToGMT;
Ayman Ramadan Soroor #:
from my experience, when I have note that there is difference between the broker time and the actual time 3 Hours.
I used timeoffset,timecurrent,rawtime and adjustedtime in my prints to check and confirm the server time.
Thank you
from my experience, when I have note that there is difference between the broker time and the actual time 3 Hours.
I used timeoffset,timecurrent,rawtime and adjustedtime in my prints to check and confirm the server time.
Of course when the internet is not connected there is no way. Therefore we should write the difference between servers and GMT time at somewhere (for example M.S word)
t - ( timecurrent() - timeGMT() )
But is there a function that give us the value of timecurrent() - timeGMT() when a broker time isn't changing?