This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community
Error obtaining PC timezone from GetTimeZoneInformationBack to topics list |
|
roche
2009.02.26 06:48
Dear all, I have encountered the below error(showing on the Experts tab) with getting the time zone: Error obtaining PC timezone from GetTimeZoneInformation in kernel32.dll. Returning 0 My PC timezone is GMT (+08:00), no matter which one I set(perth, taipei, bejing), it always show the above error. Can someone advise how to resolve it. Source:
|
|
Rosh
2009.02.26 06:59
|
|
raidsan
2010.05.11 14:30
GetTimeZoneInformation will return the right Bias even when it return TIME_ZONE_ID_UNKNOWN, so the function TimeZoneLocal() just need be modify to: double TimeZoneLocal() { int TZInfoArray[43]; if(GetTimeZoneInformation(TZInfoArray)==TIME_ZONE_ID_DAYLIGHT) return((TZInfoArray[0]+TZInfoArray[42])/(-60.0)); else//TIME_ZONE_ID_STANDARD or TIME_ZONE_ID_UNKNOWN return(TZInfoArray[0]/(-60.0)); } |
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets
