DateTime.GetMonth returns 0-based months

Hi,

I just noticed that wx.DateTime.GetMonth returns numbers in the range of 0-11.
This is quite strange considered that GetDay returns numbers in the range of
1-31. At least this is not mentioned in the docs as far I have seen.

Christian

Christian K wrote:

Hi,

I just noticed that wx.DateTime.GetMonth returns numbers in the range of 0-11.
This is quite strange considered that GetDay returns numbers in the range of
1-31. At least this is not mentioned in the docs as far I have seen.

Actually it returns items from the wxDateTime::Month enumeration, which are accessible from wxPython as wx.DateTime.Jan through wx.DateTime.Dec. In order to be compliant with most C library time and date functions wx.DateTime.Jan is equivalent to integer zero.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Christian K wrote:

Hi,

I just noticed that wx.DateTime.GetMonth returns numbers in the range
of 0-11.
This is quite strange considered that GetDay returns numbers in the
range of
1-31. At least this is not mentioned in the docs as far I have seen.

Actually it returns items from the wxDateTime::Month enumeration, which
are accessible from wxPython as wx.DateTime.Jan through wx.DateTime.Dec.
In order to be compliant with most C library time and date functions
wx.DateTime.Jan is equivalent to integer zero.

Ok, this makes sense of course.

Thanks, Christian