Download MetaTrader 5

Internet UTC time

To add comments, please log in or register
Dalta
44
Dalta  

Hello,

In my libraries I was used to implement a function called InternetUtcNow(). That function just loaded the page at https://greenwichmeantime.com/time/scripts/clock-8/x.php and read the current UTC time.

Now that page is not working anymore and I was searching for a replacement or another MQL-only way to find the current UTC (GMT) time from the web.

I know I could use NTP but, again, I would like a MQL-only solution, better if self containable in a single function.


Thanks in advance!

whroeder1
14771
whroeder1  
A lot has changed since February 3, 2014 (Build 600) like TimeGMT
Dalta
44
Dalta  
whroeder1:
A lot has changed since February 3, 2014 (Build 600) like TimeGMT


But TimeGMT read the current GMT from the local PC, what if my PC clock is wrong?

I need to read the current GMT from a reliable source

whroeder1
14771
whroeder1  
Why would it be wrong? You are connected to the internet, it defaults to updating with time.windows.com. Did you disable synchronization?
Dalta
44
Dalta  
whroeder1:
Why would it be wrong? You are connected to the internet, it defaults to updating with time.windows.com. Did you disable synchronization?


It could be wrong for many reasons but the point is that you never know that is wrong.

I would also alert the user that is clock is de-synchronized by more than N seconds, a little but useful feature

To add comments, please log in or register