Convert the timezone of my data

 
Hi guys, just a question!

I'm working on Python and I have imported some data. I live in French and we change the timezone (+1h) half of the year. How can I import data from MT5 and convert the time into UTC time? (Taking into account the timezone modification of me if it is needed of this of the broker)
 
Lucas INGLESE:
Hi guys, just a question!

I'm working on Python and I have imported some data. I live in French and we change the timezone (+1h) half of the year. How can I import data from MT5 and convert the time into UTC time? (Taking into account the timezone modification of me if it is needed of this of the broker)

Hello , you will need to take into account your brokers timezone . 

There is a library by Carl Schreiber around .

https://www.mql5.com/en/code/45287

I wanted to export to pytorch too but my broker is in Cyprus .If your's is too i have the functions ready i can send them over.

Otherwise look at the library. 

Dealing with time (2) functions
Dealing with time (2) functions
  • www.mql5.com
Calculate DST for USA, EUR, AUD and RUB and the offset time of the broker automatically from the 70's until 2030 - even in the Strategy Tester of MQ.
 
Calculated data to convert.

Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий

Библиотеки: TimeDaylightCorrections

fxsaber, 2021.09.20 12:28

2015, Europe: 2015.03.29(+1) - 2015.10.25(-1), USA: 2015.03.08(+1) - 2015.11.01(-1)
2016, Europe: 2016.03.27(+1) - 2016.10.30(-1), USA: 2016.03.13(+1) - 2016.11.06(-1)
2017, Europe: 2017.03.26(+1) - 2017.10.29(-1), USA: 2017.03.12(+1) - 2017.11.05(-1)
2018, Europe: 2018.03.25(+1) - 2018.10.28(-1), USA: 2018.03.11(+1) - 2018.11.04(-1)
2019, Europe: 2019.03.31(+1) - 2019.10.27(-1), USA: 2019.03.10(+1) - 2019.11.03(-1)
2020, Europe: 2020.03.29(+1) - 2020.10.25(-1), USA: 2020.03.08(+1) - 2020.11.01(-1)
2021, Europe: 2021.03.28(+1) - 2021.10.31(-1), USA: 2021.03.14(+1) - 2021.11.07(-1)
2022, Europe: 2022.03.27(+1) - 2022.10.30(-1), USA: 2022.03.13(+1) - 2022.11.06(-1)
2023, Europe: 2023.03.26(+1) - 2023.10.29(-1), USA: 2023.03.12(+1) - 2023.11.05(-1)
2024, Europe: 2024.03.31(+1) - 2024.10.27(-1), USA: 2024.03.10(+1) - 2024.11.03(-1)