MQL4参考 日期和时间 TimeToStruct

TimeToStruct

Converts a value of datetime type (number of seconds since 01.01.1970) into a structure variable MqlDateTime.

void  TimeToStruct(
   datetime      dt,            // date and time
   MqlDateTime&  dt_struct      // structure for the adoption of values
   );

Parameters

dt

[in]  Date value to convert.

dt_struct

[out]  Variable of structure type MqlDateTime.

Return Value

True if successful, otherwise false. To get information about the error, call the GetLastError() function.