TimeDayOfWeek - Date and Time - MQL4 Reference

MQL4 Reference Date and Time TimeDayOfWeek

TimeDayOfWeek

Returns the zero-based day of week (0 means Sunday,1,2,3,4,5,6) of the specified date.

int  TimeDayOfWeek(
   datetime      date            // date and time
   );

Parameters

date

[in]  Datetime as number of seconds elapsed since midnight (00:00:00), January 1, 1970.

Returned value

The zero-based day of week (0 means Sunday,1,2,3,4,5,6) of the specified date.

Example:

  int weekday=TimeDayOfWeek(D'2004.11.2');
  // day is 2 - Tuesday