MQL4 Reference Date and Time TimeDayOfYear

MQL4 Help as One File:

TimeDayOfYear

Returns the day of year of the specified date.

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

Parameters

date

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

Returned value

Day (1 means 1 January,..,365(6) does 31 December) of year of the specified date.

Example:

  int nday=TimeDayOfYear(TimeCurrent());