A cautionary note about wx.DateTime

I’d have to guess that this has been noted somewhere but I can’t find it.
The perpetual oddity of the month in wx.DateTime starting at 0 (zero) is well documented but if by error, you input 12 for the month number for December, as opposed to 11, the date returned is a valid date but is a date in October.

So oddity on top of an oddity, which can drive you wild, hunting through code, looking for where you added/subtracted or somehow corrupted your month number.

>>> wx.DateTime(8,12,2014)
<wx.DateTime: "Wed Oct  8 00:00:00 2014">
>>> wx.DateTime(8,12,2023)
<wx.DateTime: "Sun Oct  8 00:00:00 2023">
>>> 

wx.version()
‘4.2.1 gtk3 (phoenix) wxWidgets 3.2.2.1’

I know you can refer to the months by name but sometimes the real world creeps in, forcing you to handle numeric input for the month, so beware or spend a lot of time scratching your head.

Yes, it is a very strange API. To be honest I would recommend using Python’s datetime module instead.