How i can get current broker server time?

Mohammad Ansari  
Marco vd Heijden:

Does it work when market is close?

William Roeder  
  1. TimeCurrent returns seconds.
  2. When the market is closed, there are no updating ticks; the last time received is the server time. Why do you care? Nothing has changed.
Marco vd Heijden  
Mohammad Ansari:

Does it work when market is close?

Yes it works but usually on Crypto only because most Forex servers are halted in weekends.

Steve Clark  
Mohammad Ansari:

Does it work when market is close?

datetime  TimeCurrent();

 returns the last known server time of the last tick (so it stops when the market is closed)


datetime  TimeTradeServer();


returns the time calculated for the trade server (based on the time settings of your computer and the difference between your local time and trade server time) - works when the markets are closed.

Muhammad Syamil Bin Abdullah  
Steve Clark:

datetime  TimeCurrent();

 returns the last known server time of the last tick (so it stops when the market is closed)


datetime  TimeTradeServer();


returns the time calculated for the trade server (based on the time settings of your computer and the difference between your local time and trade server time) - works when the markets are closed.

Thanks for the tip.

Reason: