MQL4参考 日期和时间 TimeYear

TimeYear

Returns year of the specified date.

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

Parameters

date

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

Returned value

Year of the specified date. The returned value can be within the range of 1970 to 3000.

Example:

  int y=TimeYear(TimeCurrent());