How to determine the week day from my LocalTime in MT4 and MT5?


I am just looking for a way to get the day of the week from my LocalTime in a program.

Is there a way/function for that please ?

Tx in advance.

MT4 or MT5?

For MT4 it is simple :


For MT5 a just bit more complicated - you can do something like this :

 MqlDateTime _timeLocal; TimeToStruct(TimeLocal(),_timeLocal);
            int _timeDayOfWeek = _timeLocal.day_of_week;
or use the _timeLocal.day_of_week directly (without creating a new variable)

Tx! That was for MT5 :wink: