Is struct{...} enabled in MQL?

 

Hello,

I want to use WinAPI function

void GetSystemTime(int lpSystemTime);

where lpSystemTime is pointer to structure SYSTEMTIME. Is it possible to define such structure in mql? Or how can i use GetSystemTime() in MQL?

Thanks for all responses

 
 
Dom:

I want to use WinAPI function

void GetSystemTime(int lpSystemTime);

where lpSystemTime is pointer to structure SYSTEMTIME. Is it possible to define such structure in mql? Or how can i use GetSystemTime() in MQL?

Use of GetSystemTime() is covered in the following post: 'GMT from external Source'. If you are planning to use GetSystemTime() in order to establish UTC time rather than local/broker time, then you may find it more flexible to get timezone information (also illustrated in the old post) and use that to adjust the values returned by the MQL TimeCurrent() and TimeLocal() functions.

 
jjc:

Use of GetSystemTime() is covered in the following post: 'GMT from external Source'. If you are planning to use GetSystemTime() in order to establish UTC time rather than local/broker time, then you may find it more flexible to get timezone information (also illustrated in the old post) and use that to adjust the values returned by the MQL TimeCurrent() and TimeLocal() functions.


Thank you very very much for posting this link to the GMT information. This was so helpful and solved my problem

 
See my code for TimeGMT() implementation.
Reason: