... and if I had half a brain I'd realize that the day of month is set to 31
and it was the months that don't have 31 days that have a problem. Doh!
Mark
···
-----Original Message-----
From: Mark Morga [mailto:MMORGA@espectech.com]
Sent: Wednesday, February 06, 2002 10:49 AM
To: 'wxpython-users@lists.wxwindows.org'
Subject: RE: [wxPython] Strange behavior in wxDateTime.SetMonth> > wxDateTime.SetMonth() fails for the following months:
> >
> > Feb, Apr, Jun, Sep, Nov.
> >
> > Here's a test case that illustrates the problem.
> >
> > def testSetMonth(self):
> > dateTime = wxDateTime()
>
> Don't you need to initialise dateTime? If I try to print
> dateTime here, I
> get an exception. So I'd expect that setting a single part
> (the month) could
> well give undefined results.
>
> Do you get the same thing if you initialise dateTime to
> today's date & time?
>
> Paul.
>Good point, Paul. If I initialize the date with wxDateTimeFromDMY or
wxDateTime_Now the problem doesn't occur. However, it's
strange that the
problem only occurs for five of the months.I wrote a test in C++ (which I should have done in the first
place) and I
get the exact same behavior. The problem isn't in wxPython
(I will ammend
the bug report - if I can figure out how to) and I'll look at
the wxWindows
source to see if I can figure out what is happening.Thanks!
Mark
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users