-
Notifications
You must be signed in to change notification settings - Fork 532
DateTime.FromTimeT() generates invalid dates #1910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This might be a Windows-specific problem. I don't see any problems on Linux. I wonder if this is related to the Locale issues on Windows with 4.1.x? |
Scratch that about the Locale issues - don't think it's related. Still could be Windows specific though. Are you using 32-bit or 64-bit Python on Windows? |
This may well be Windows-specific; I could not reproduce it on MacOS. I'm using the 64b Python: |
It looks like there may be something going on with converting to the C |
FWIW, it seems to act like the start of the epoch is wrong. The dates are far future, but seem consistent with the value entered. >>> wx.DateTime.FromTimeT(0)
<wx.DateTime: "Mon Dec 2 05:12:16 55185">
>>> wx.DateTime.FromTimeT(1)
<wx.DateTime: "Mon Dec 2 05:12:17 55185"> |
I had an incorrect typedef, so on Windows where |
I have a similar observation. The following code
generates
Packages: I'm on a Windows 10 PC with miniconda installation. |
@Jalkhov, the month parameter actually an enumeration, not 1-12 for Jan-Dec. So, 1 is actually February. February 29 doesn't exist in 2023.
It is a bit strange, I know. |
Operating system: Windows 10 (build 10.0.18363)
wxPython version & source: 4.1.1 from PyPI
Python version & source: Stock 3.7.4 and stock 3.9.1
Description of the problem:
DateTime.FromTimeT()
is failing in Python 3.7.4 and 3.9.1. The results are slightly different, although that may simply be the reporting; it looks like the same root problem.In 3.7.4, the method executes, but generates bad values (equivalent Python
datetime
used to show expected behavior):In 3.9.1, the same call to



wx.DateTime.FromTimeT()
produces a series of wxPython Debug Alert dialogs before the Python interpreter shuts down:In 3.7.4, the
wx,DateTime.FromTimeT()
results are the same whether awx.App
is running or not. In 3.9.1, the debug alerts only show up if awx.App
has not been instantiated; without it, the interpreter simply shuts down.I can't verify it at the moment, but I believe
DateTime.FromTimeT()
was working in wxPython 4.0.7; I skipped 4.1.0.The text was updated successfully, but these errors were encountered: