Or maybe 01.01.2012 :)
You should not have used the term"winter" time.
It should be called standard time, because according to the rules (and even in Windows as well) it is called standard time.
Winter is a common name. It is not summer.
When you call it Summer or Standard, it is immediately clear that it is summer time that is not standard, which has an extra hour.
Great article. It's nice when everything is collected and after reading it all builds up in your head into a system.
I would like more information on the transition (or not) of different exchanges to summer time.
And also I am interested in the question of how to programme testing taking into account Forex time zones, if some exchanges switch to summer time and others do not?
At the same time, the dates of transition are different everywhere, and the rules for selecting these dates may have changed over the years.
Has anyone coded something like this?
I will add my penny. Function for getting the time parameter (using it in the code is more compact).
//===================================================================================================================== // Returns the required time parameter // int TimeGet(datetime).year; // year // int TimeGet(datetime).mon; // month // int TimeGet(datetime).day; // day // int TimeGet(datetime).hour; // hour // int TimeGet(datetime).min; // minutes // int TimeGet(datetime).sec; // seconds // int TimeGet(datetime).day_of_week; // day of the week (0-Sunday, 1-Monday, ...,6-Saturday). // int TimeGet(datetime).day_of_year; // ordinal number in the year (1 January has the number 0) //===================================================================================================================== MqlDateTime TimeGet(datetime par_time) { MqlDateTime stm; TimeToStruct(par_time, stm); return(stm); }
It seems to work, but when you enter a point the drop-down list of elements of MqlDateTime structure does not appear :(

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article MQL5 Programming Basics: Time is published:
The article focuses on standard MQL5 functions for working with time, as well as programming techniques and practically useful functions for working with time that are required when creating Expert Advisors and indicators. Particular attention is paid to the general theory of time measurement. This article should be of interest primarily to novice MQL5 programmers.
Author: Dmitry Fedoseev