Problem using MqlDateTime

 

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
 
Please, provide the source which demonstrates this issue.

 
Rosh:
Please, provide the source which demonstrates this issue.

Hello Rosh


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

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


the result is always zero

 

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

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



 
Rosh:

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



Thank you so much , it is working now ......All the best wishes