MQL4参考 日期和时间 TimeLocal


Returns the local time of a computer, where the client terminal is running. There are 2 variants of the function.

Call without parameters

datetime  TimeLocal();

Call with MqlDateTime type parameter

datetime  TimeLocal(
   MqlDateTime&  dt_struct      // Variable of structure type



[out]  Variable of structure type MqlDateTime.

Return Value

Value of datetime type


If the MqlDateTime structure type variable has been passed as a parameter, it is filled accordingly.

To arrange high-resolution counters and timers, use the GetTickCount() function, which produces values in milliseconds.

During testing in the Strategy Tester, TimeLocal() is always equal to TimeCurrent() simulated server time.