Download MetaTrader 5

Problem using MqlDateTime

To add comments, please log in or register
Thousands of developers have already published their products in the Market. Join them!
Oraib
424
Oraib 2010.06.14 17:51 

Hello 

After the last update MqlDateTime is not working and returning 0 all the time .

Documentation on MQL5: Standard Constants, Enumerations and Structures / Data Structures / Structure of the Date Type
  • www.mql5.com
Standard Constants, Enumerations and Structures / Data Structures / Structure of the Date Type - Documentation on MQL5
Rashid Umarov
Admin
11928
Rashid Umarov 2010.06.14 18:12  
Please, provide the source which demonstrates this issue.

Oraib
424
Oraib 2010.06.14 18:44  
Rosh:
Please, provide the source which demonstrates this issue.

Hello Rosh


//+------------------------------------------------------------------+
void OnTick()
  { MqlDateTime dt;
    Alert(dt.hour);
  }

//+------------------------------------------------------------------+


the result is always zero


Rashid Umarov
Admin
11928
Rashid Umarov 2010.06.14 19:27  

You didn't initialze the dt value, try this:

void OnTick()
  { MqlDateTime dt;
    TimeCurrent(dt);
    Alert(dt.hour);
  }



Oraib
424
Oraib 2010.06.14 21:07  
Rosh:

You didn't initialze the dt value, try this:



Thank you so much , it is working now ......All the best wishes
To add comments, please log in or register