Download MetaTrader 5

Confused with using TimeGMT()?

To add comments, please log in or register
Sherif Hasan
7400
Sherif Hasan  

I want to display GMT time on chart.

i used Comment(TimeGMT());

shows error!

Please advise me how to use TimeGMT() function?

whroeder1
16086
whroeder1  

It is not showing an error. It is doing exactly what it is supposed to do. Read the documentation. What's New in MQL4 - MQL4 Documentation Feb 2014

The string representation of datetime type depends on compilation mode:

  datetime date=D'2014.03.05 15:46:58';
  string str="mydate="+date;
//--- str="mydate=1394034418" - old compiler/new compiler without #property strict
//--- str="mydate=2014.03.05 15:46:58" - new compiler with #property strict
Comment( TimeToString( TimeGMT() ) );





Sherif Hasan
7400
Sherif Hasan  
WHRoeder:

It is not showing an error. It is doing exactly what it is supposed to do. Read the documentation. What's New in MQL4 - MQL4 Documentation Feb 2014





WHRoeder:

It is not showing an error. It is doing exactly what it is supposed to do. Read the documentation. What's New in MQL4 - MQL4 Documentation Feb 2014


Oops. Yes. i am using old compiler. now it works for me , no errors with new compiler



To add comments, please log in or register