Time Handling

To add comments, please log in or register
24h-worker
97
24h-worker  

In MQL4 I could write:

 

MqlDateTime ttt;

actualDay = ttt.day_of_week;   //  MQL5 returns 0

 

 

In MQL5 this functioned:

 

MqlDateTime ttt;

    TimeToStruct(TimeCurrent(),ttt);
    myDay = ttt.day_of_week; 

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
Al W
163
Al W  
24h-worker :

In MQL4 I could write:

 

MqlDateTime ttt;

actualDay = ttt.day_of_week;   //  MQL5 returns 0

 

 

In MQL5 this functioned:

 

MqlDateTime ttt;

    TimeToStruct(TimeCurrent(),ttt);
    myDay = ttt.day_of_week; 

 

 


You could also make a function that does it the old way. 

Use the following include file:


Files:
To add comments, please log in or register