How i can get current broker server time?

 

Hi i'm new to mql so sorry for my question if it is a dump

I want to know the current time of broker server in miliseconds 

How i can do this?

Can i findout server time when market is closed?

Thanks For reading this

 
datetime server_time = TimeCurrent();
 
Marco vd Heijden:

Does it work when market is close?

 
  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.
 
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.

 
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.

 
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: