Closed stephanbracke closed 2 years ago
After investigation I noted that the real problem is also linked with time.mktime on windows. Behind the scenes it will use a C runtime dll and the description can be found here https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/asctime-wasctime?redirectedfrom=MSDN&view=msvc-170 Here you notice that the year parameter = Year (current year minus 1900) and also 0 based months . Anyway because we depend on the C++ library behaviour we need to avoid the use of mktime in the code base in order to have a code that works on windows
Herunder a summary of the places where mktime is used (after I corrected the issues #112 and #111 ) It is most of the time the same thing and can easily be solved with the same approach. You can safely delete the try except code as well. It is concentrated in the files developmentpage.py and dialogclasses.py If you made the currently class method _pydate2wxdate as a global one. You could reuse this method everywhere (normally this code should work correctly, however I didn't test it)
All references to DateTimeFromTimeT(...mktime...) where replaced using DateTime.fromDMY. Solved with a9352b4d65f00c8be2cb196c4512934e72e9f8c0 and 429e3425fe1ad4b77830a4f5cad2b34172b02418
this is linked with issue #112 and #111 If I search on the methods wx.DateTimeFromTimeT and wx.DateTime.FromTimeT I notice that they are used on several places in the gui py classes. From my current testing I saw that these cause problems on windows and the simple solution is to replace them with
This cleaning needs to be done to avoid strange behaviours on windows machines