MQL4 Reference Date and Time Year

Year

Returns the current year, i.e., the year of the last known server time.

int  Year();

Returned value

Current year.

Note

At the testing, the last known server time is modelled.

Example:

  // return if the date is within the range from 1 Jan. to 30 Apr., 2006.
    if(Year()==2006 && Month()<5)
    return(0);